From: Mark Brown Date: Tue, 12 Jun 2012 01:46:26 +0000 (+0800) Subject: pda_power: Complain if regulator operations fail X-Git-Tag: firefly_0821_release~3680^2~2287^2~23 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92311c3c70f9b7f1b7860c2fc2ada09b4d43bfea;p=firefly-linux-kernel-4.4.55.git pda_power: Complain if regulator operations fail 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 Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c index 214468f4444a..ed54a3551148 100644 --- a/drivers/power/pda_power.c +++ b/drivers/power/pda_power.c @@ -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; } }