lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 18 Apr 2014 11:30:10 -0700
From:	Tim Kryger <tim.kryger@...aro.org>
To:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>
CC:	Tim Kryger <tim.kryger@...aro.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] regulator: Allow set voltage on fixed regulators

If a regulator consumer requests a voltage range that can be satisfied,
the return value should indicate success even if that regulator has a
fixed voltage.  Since there is already logic to check if the requested
voltage range overlaps the allowed range, set REGULATOR_CHANGE_VOLTAGE
for regulators with constraints that include a positive voltage.

Signed-off-by: Tim Kryger <tim.kryger@...aro.org>
---
 drivers/regulator/of_regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index ea4f36f..a205d62 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -36,7 +36,7 @@ static void of_get_regulation_constraints(struct device_node *np,
 		constraints->max_uV = be32_to_cpu(*max_uV);
 
 	/* Voltage change possible? */
-	if (constraints->min_uV != constraints->max_uV)
+	if (constraints->max_uV > 0)
 		constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
 	/* Only one voltage?  Then make sure it's set. */
 	if (min_uV && max_uV && constraints->min_uV == constraints->max_uV)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ