Skip to content

Commit 2437fcc

Browse files
committed
Merge tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 6c6ee53 + d92d95b commit 2437fcc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/regulator/core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,9 +2519,12 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
25192519
{
25202520
struct regulator_dev *rdev = regulator->rdev;
25212521
struct regulator *consumer;
2522-
int ret, output_uV, input_uV, total_uA_load = 0;
2522+
int ret, output_uV, input_uV = 0, total_uA_load = 0;
25232523
unsigned int mode;
25242524

2525+
if (rdev->supply)
2526+
input_uV = regulator_get_voltage(rdev->supply);
2527+
25252528
mutex_lock(&rdev->mutex);
25262529

25272530
/*
@@ -2554,10 +2557,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
25542557
goto out;
25552558
}
25562559

2557-
/* get input voltage */
2558-
input_uV = 0;
2559-
if (rdev->supply)
2560-
input_uV = regulator_get_voltage(rdev->supply);
2560+
/* No supply? Use constraint voltage */
25612561
if (input_uV <= 0)
25622562
input_uV = rdev->constraints->input_uV;
25632563
if (input_uV <= 0) {

0 commit comments

Comments
 (0)