diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-15 16:49:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-15 16:49:21 -0400 |
commit | d5b2e30bdc695a1735b3c970e1f9738e9ca3dbf0 (patch) | |
tree | 79e832eb50d3b416bdada4903b2a2e2fefcc2800 /drivers/regulator | |
parent | 7c7fac30581b2fe2e0783d9b6f53ca333cc2296c (diff) | |
parent | 84a1caf1453c3d44050bd22db958af4a7f99315c (diff) |
Merge tag 'v3.5-rc7' into regulator-drivers
Linux 3.5-rc7
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 8d81bafcb721..08ccf03f1dd8 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) | |||
2636 | { | 2636 | { |
2637 | struct regulator_dev *rdev = regulator->rdev; | 2637 | struct regulator_dev *rdev = regulator->rdev; |
2638 | struct regulator *consumer; | 2638 | struct regulator *consumer; |
2639 | int ret, output_uV, input_uV, total_uA_load = 0; | 2639 | int ret, output_uV, input_uV = 0, total_uA_load = 0; |
2640 | unsigned int mode; | 2640 | unsigned int mode; |
2641 | 2641 | ||
2642 | if (rdev->supply) | ||
2643 | input_uV = regulator_get_voltage(rdev->supply); | ||
2644 | |||
2642 | mutex_lock(&rdev->mutex); | 2645 | mutex_lock(&rdev->mutex); |
2643 | 2646 | ||
2644 | /* | 2647 | /* |
@@ -2671,10 +2674,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) | |||
2671 | goto out; | 2674 | goto out; |
2672 | } | 2675 | } |
2673 | 2676 | ||
2674 | /* get input voltage */ | 2677 | /* No supply? Use constraint voltage */ |
2675 | input_uV = 0; | ||
2676 | if (rdev->supply) | ||
2677 | input_uV = regulator_get_voltage(rdev->supply); | ||
2678 | if (input_uV <= 0) | 2678 | if (input_uV <= 0) |
2679 | input_uV = rdev->constraints->input_uV; | 2679 | input_uV = rdev->constraints->input_uV; |
2680 | if (input_uV <= 0) { | 2680 | if (input_uV <= 0) { |