aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-05 10:12:20 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-05 10:12:20 +0800
commit5fb910d39133cc28ec25d4b2eea26b48f3ab4ef1 (patch)
tree1040b83ee991152ed7785ba27fe1c6710c77fdb2
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
parentfbe31057fafebdc2811a7101b8b4a0460f5417d1 (diff)
downloadlinux-security-5fb910d39133cc28ec25d4b2eea26b48f3ab4ef1.tar.gz
Merge remote-tracking branch 'regulator/fix/core' into tmp
-rw-r--r--drivers/regulator/core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index da9782bd27d0a1..4a7790c58257d6 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;
}