diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-11-13 03:48:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-14 21:14:18 -0500 |
commit | f0f98b19e23d4426ca185e3d4ca80e6aff5ef51b (patch) | |
tree | 0399ff57ee6b76d9bacd3df18b0483197fb3281b /drivers/regulator | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) |
regulator: fix voltage check in regulator_is_supported_voltage()
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>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5c4829cba6a6..27eb9d66f06a 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1974,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | |||
1974 | if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { | 1974 | if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { |
1975 | ret = regulator_get_voltage(regulator); | 1975 | ret = regulator_get_voltage(regulator); |
1976 | if (ret >= 0) | 1976 | if (ret >= 0) |
1977 | return (min_uV >= ret && ret <= max_uV); | 1977 | return (min_uV <= ret && ret <= max_uV); |
1978 | else | 1978 | else |
1979 | return ret; | 1979 | return ret; |
1980 | } | 1980 | } |