Skip to content

Commit

Permalink
Merge tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "A smallish fix for a lock dependency issue which affects a bunch of
  Qualcomm boards that do unusually complicated things with their
  regulators, the API is unlikely to be called by any other system."

* tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Fix recursive mutex lockdep warning
  • Loading branch information
Linus Torvalds committed Jul 9, 2012
2 parents 6c6ee53 + d92d95b commit 2437fcc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2437fcc

Please sign in to comment.