Skip to contentSkip to conversation

power_supply: pda_power: Complain if regulator operations fail

PATCH New Mark Brown 1 participant 1 message May 7, 2012

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 power_supply: 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.

---
 drivers/power/pda_power.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/pda_power.c +2 -2
index 214468f..ed54a35 100644
@@ -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;
 			}
 		}
Signature · 1 line
1.7.10