diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-18 23:56:20 +0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-09-22 16:32:44 +0400 |
commit | 656d0498ea14c51cd8ec00081b5e0662acc72614 (patch) | |
tree | 0b95569933d453fb7039a0e690a5eff71d553dc7 | |
parent | 77bb8ff968dddb42a773c7b32d1a6a07f96f3f79 (diff) | |
download | linux-656d0498ea14c51cd8ec00081b5e0662acc72614.tar.xz |
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>
-rw-r--r-- | drivers/regulator/da903x.c | 2 |
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; |