diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-08 03:39:34 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-17 16:01:21 -0400 |
commit | ee5e6253ac22210da892435711890fa2272daa41 (patch) | |
tree | 067bec34854e22272acd182b597d3fc03ac03251 /drivers | |
parent | e08ef739feec5341fe9382a9f5173ddd56c95f93 (diff) |
regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage
The voltage range checking should be to ensure mc13xxx_regulators[id].voltages[0]
falls with min_uV and max_uV.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/mc13xxx-regulator-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index 4fa9704739bc..3e191715fb25 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c | |||
@@ -158,8 +158,8 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV, | |||
158 | dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n", | 158 | dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n", |
159 | __func__, id, min_uV, max_uV); | 159 | __func__, id, min_uV, max_uV); |
160 | 160 | ||
161 | if (min_uV >= mc13xxx_regulators[id].voltages[0] && | 161 | if (min_uV <= mc13xxx_regulators[id].voltages[0] && |
162 | max_uV <= mc13xxx_regulators[id].voltages[0]) | 162 | mc13xxx_regulators[id].voltages[0] <= max_uV) |
163 | return 0; | 163 | return 0; |
164 | else | 164 | else |
165 | return -EINVAL; | 165 | return -EINVAL; |