diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-28 21:36:38 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-03 14:00:46 +0100 |
commit | 01e86f4988297abb403be92bc3b6ad24e1d058de (patch) | |
tree | c032a91cf7a8a6f140c0104a4cb681600bcf42b0 /drivers/regulator/core.c | |
parent | dd775ae2549217d3ae09363e3edb305d0fa19928 (diff) | |
download | lwn-01e86f4988297abb403be92bc3b6ad24e1d058de.tar.gz lwn-01e86f4988297abb403be92bc3b6ad24e1d058de.zip |
regulator: core: Complain if we can't reenable a supply
When cleaning up after a failed bulk_disable() we try to reenable any
supplies that we did manage to disable - complain if we fail to do that
when we try.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-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 c056abd7562a..fe28481dc91c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2566,7 +2566,7 @@ int regulator_bulk_disable(int num_consumers, struct regulator_bulk_data *consumers) { int i; - int ret; + int ret, r; for (i = num_consumers - 1; i >= 0; --i) { ret = regulator_disable(consumers[i].consumer); @@ -2578,8 +2578,12 @@ int regulator_bulk_disable(int num_consumers, err: pr_err("Failed to disable %s: %d\n", consumers[i].supply, ret); - for (++i; i < num_consumers; ++i) - regulator_enable(consumers[i].consumer); + for (++i; i < num_consumers; ++i) { + r = regulator_enable(consumers[i].consumer); + if (r != 0) + pr_err("Failed to reename %s: %d\n", + consumers[i].supply, r); + } return ret; } |