diff options
| author | 2012-07-16 12:32:42 -0700 | |
|---|---|---|
| committer | 2012-07-16 12:32:42 -0700 | |
| commit | 467a3ca5cab64a16b5ec46ebb1895c84c280dcfe (patch) | |
| tree | 68096d5b17e884d270420d50e466186c73019830 /drivers/regulator/core.c | |
| parent | tty ldisc: Close/Reopen race prevention should check the proper flag (diff) | |
| parent | Linux 3.5-rc7 (diff) | |
| download | linux-dev-467a3ca5cab64a16b5ec46ebb1895c84c280dcfe.tar.xz linux-dev-467a3ca5cab64a16b5ec46ebb1895c84c280dcfe.zip | |
Merge branch 'v3.6-rc7' into tty-next
This is to sync up on Linus's branch to get the other tty and core changes.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/regulator/core.c')
| -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 09a737c868b5..8b4b3829d9e7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2519,9 +2519,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); /* @@ -2554,10 +2557,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) { |
