aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da903x.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-09-18 15:56:20 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 08:32:44 -0400
commit656d0498ea14c51cd8ec00081b5e0662acc72614 (patch)
tree0b95569933d453fb7039a0e690a5eff71d553dc7 /drivers/regulator/da903x.c
parent77bb8ff968dddb42a773c7b32d1a6a07f96f3f79 (diff)
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,
301 } 301 }
302 302
303 val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV; 303 val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
304 val = (val > 7 || val < 20) ? 8 : val - 12; 304 val = (val > 7 && val < 20) ? 8 : val - 12;
305 val <<= info->vol_shift; 305 val <<= info->vol_shift;
306 mask = ((1 << info->vol_nbits) - 1) << info->vol_shift; 306 mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;
307 307