Skip to content

Commit

Permalink
pda_power: Complain if regulator operations fail
Browse files Browse the repository at this point in the history
Rather than silently ignoring errors from the regulator enable and disable
add a WARN_ON() - it's probably pretty important if we're not getting
power, though it should be vanishingly unlikely in production.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Mark Brown authored and Anton Vorontsov committed Jun 18, 2012
1 parent 485802a commit 92311c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/pda_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ static void update_charger(void)
regulator_set_current_limit(ac_draw, max_uA, max_uA);
if (!regulator_enabled) {
dev_dbg(dev, "charger on (AC)\n");
regulator_enable(ac_draw);
WARN_ON(regulator_enable(ac_draw));
regulator_enabled = 1;
}
} else {
if (regulator_enabled) {
dev_dbg(dev, "charger off\n");
regulator_disable(ac_draw);
WARN_ON(regulator_disable(ac_draw));
regulator_enabled = 0;
}
}
Expand Down

0 comments on commit 92311c3

Please sign in to comment.