From: Ranjani Vaidyanathan Date: Thu, 12 May 2011 00:13:43 +0000 (-0500) Subject: ENGR00143294-1: Fix bug in MC13892 driver X-Git-Tag: v3.0.35-fsl~2343 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2e3d2908bb3c0178e929c28727a9bd72efba0bf1;p=karo-tx-linux.git ENGR00143294-1: Fix bug in MC13892 driver In set_voltage function, all voltages are not in microvolts. Hence set_voltage function was failing. Change all voltages in the function to be in microvolts. Signed-off-by: Ranjani Vaidyanathan --- diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index 3285d41842f2..04ce02869d9c 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c @@ -452,12 +452,11 @@ static int mc13892_sw_regulator_set_voltage(struct regulator_dev *rdev, if (ret) goto err; + hi = val & MC13892_SWITCHERS0_SWxHI; if (value > 1375000) hi = 1; - else if (value < 1100000) + if (value < 1100000) hi = 0; - else - hi = valread & MC13892_SWITCHERS0_SWxHI; if (hi) { value = (value - 1100000) / 25000;