pda_power: Complain if regulator operations fail
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 12 Jun 2012 01:46:26 +0000 (09:46 +0800)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Mon, 18 Jun 2012 03:19:59 +0000 (20:19 -0700)
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>
drivers/power/pda_power.c

index 214468f..ed54a35 100644 (file)
@@ -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;
                        }
                }