summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da903x.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-09-18 12:56:20 -0700
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 13:32:44 +0100
commit656d0498ea14c51cd8ec00081b5e0662acc72614 (patch)
tree0b95569933d453fb7039a0e690a5eff71d553dc7 /drivers/regulator/da903x.c
parent77bb8ff968dddb42a773c7b32d1a6a07f96f3f79 (diff)
downloadlinux-656d0498ea14c51cd8ec00081b5e0662acc72614.tar.bz2
regulator: fix calculation of voltage range in da9034_set_ldo12_voltage()
For val to be greater than 7 or less than 20 is logically always true. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/da903x.c')
-rw-r--r--drivers/regulator/da903x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c
index 7d9c2506d215..c9de73098470 100644
--- a/drivers/regulator/da903x.c
+++ b/drivers/regulator/da903x.c
@@ -301,7 +301,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev,
}
val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
- val = (val > 7 || val < 20) ? 8 : val - 12;
+ val = (val > 7 && val < 20) ? 8 : val - 12;
val <<= info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;