Merge remote-tracking branch 'regulator/fix/core' into tmp
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Mar 2013 02:12:20 +0000 (10:12 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Mar 2013 02:12:20 +0000 (10:12 +0800)
drivers/regulator/core.c

index da9782b..4a7790c 100644 (file)
@@ -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;
 }