mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
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>
This commit is contained in:
parent
e08ef739fe
commit
ee5e6253ac
1 changed files with 2 additions and 2 deletions
|
@ -158,8 +158,8 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
|
||||||
dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
|
dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
|
||||||
__func__, id, min_uV, max_uV);
|
__func__, id, min_uV, max_uV);
|
||||||
|
|
||||||
if (min_uV >= mc13xxx_regulators[id].voltages[0] &&
|
if (min_uV <= mc13xxx_regulators[id].voltages[0] &&
|
||||||
max_uV <= mc13xxx_regulators[id].voltages[0])
|
mc13xxx_regulators[id].voltages[0] <= max_uV)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in a new issue