summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-15 21:49:21 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-15 21:49:21 +0100
commitd5b2e30bdc695a1735b3c970e1f9738e9ca3dbf0 (patch)
tree79e832eb50d3b416bdada4903b2a2e2fefcc2800 /drivers/regulator
parent7c7fac30581b2fe2e0783d9b6f53ca333cc2296c (diff)
parent84a1caf1453c3d44050bd22db958af4a7f99315c (diff)
Merge tag 'v3.5-rc7' into regulator-drivers
Linux 3.5-rc7
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8d81bafcb72..08ccf03f1dd 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2636,9 +2636,12 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
{
struct regulator_dev *rdev = regulator->rdev;
struct regulator *consumer;
- int ret, output_uV, input_uV, total_uA_load = 0;
+ int ret, output_uV, input_uV = 0, total_uA_load = 0;
unsigned int mode;
+ if (rdev->supply)
+ input_uV = regulator_get_voltage(rdev->supply);
+
mutex_lock(&rdev->mutex);
/*
@@ -2671,10 +2674,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
goto out;
}
- /* get input voltage */
- input_uV = 0;
- if (rdev->supply)
- input_uV = regulator_get_voltage(rdev->supply);
+ /* No supply? Use constraint voltage */
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV;
if (input_uV <= 0) {