From 2e3d2908bb3c0178e929c28727a9bd72efba0bf1 Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Wed, 11 May 2011 19:13:43 -0500 Subject: [PATCH] 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 --- drivers/regulator/mc13892-regulator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.39.2