diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-05 10:12:20 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-05 10:12:20 +0800 |
commit | 5fb910d39133cc28ec25d4b2eea26b48f3ab4ef1 (patch) | |
tree | 1040b83ee991152ed7785ba27fe1c6710c77fdb2 /drivers | |
parent | Linux 3.9-rc1 (diff) | |
parent | regulator: fixed regulator_bulk_enable unwinding code (diff) | |
download | linux-dev-5fb910d39133cc28ec25d4b2eea26b48f3ab4ef1.tar.xz linux-dev-5fb910d39133cc28ec25d4b2eea26b48f3ab4ef1.zip |
Merge remote-tracking branch 'regulator/fix/core' into tmp
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index da9782bd27d0..4a7790c58257 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3057,9 +3057,13 @@ int regulator_bulk_enable(int num_consumers, return 0; err: - pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret); - while (--i >= 0) - regulator_disable(consumers[i].consumer); + for (i = 0; i < num_consumers; i++) { + if (consumers[i].ret < 0) + pr_err("Failed to enable %s: %d\n", consumers[i].supply, + consumers[i].ret); + else + regulator_disable(consumers[i].consumer); + } return ret; } |