diff options
-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, | |||
3057 | return 0; | 3057 | return 0; |
3058 | 3058 | ||
3059 | err: | 3059 | err: |
3060 | pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret); | 3060 | for (i = 0; i < num_consumers; i++) { |
3061 | while (--i >= 0) | 3061 | if (consumers[i].ret < 0) |
3062 | regulator_disable(consumers[i].consumer); | 3062 | pr_err("Failed to enable %s: %d\n", consumers[i].supply, |
3063 | consumers[i].ret); | ||
3064 | else | ||
3065 | regulator_disable(consumers[i].consumer); | ||
3066 | } | ||
3063 | 3067 | ||
3064 | return ret; | 3068 | return ret; |
3065 | } | 3069 | } |