summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-11-13 09:48:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 12:14:09 -0800
commit1a62325ca4a3dda40da10a21806b6baa2c8d40dd (patch)
treeb97cbf5c62bcde8d2e0c35bc6df46c1822099a4d /drivers
parentab37cb2a6cde96c269a9cfb14b4affbe5fe11675 (diff)
regulator: fix voltage check in regulator_is_supported_voltage()
commit f0f98b19e23d4426ca185e3d4ca80e6aff5ef51b upstream. regulator_is_supported_voltage() should return true only if the voltage of fixed/constant regulator is between min_uV and max_uV. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 48385318175a..e6f2990a407d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1942,7 +1942,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
ret = regulator_get_voltage(regulator);
if (ret >= 0)
- return (min_uV >= ret && ret <= max_uV);
+ return (min_uV <= ret && ret <= max_uV);
else
return ret;
}