public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power_supply: pda_power: Complain if regulator operations fail
@ 2012-06-12  1:46 Mark Brown
  2012-06-18  4:35 ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-06-12  1:46 UTC (permalink / raw)
  To: Anton Vorontsov, David Woodhouse; +Cc: linux-kernel, Mark Brown

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>
---
 drivers/power/pda_power.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index 214468f..ed54a35 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;
 			}
 		}
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] power_supply: pda_power: Complain if regulator operations fail
@ 2012-05-07 17:21 Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-05-07 17:21 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-kernel, Mark Brown

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>
---
 drivers/power/pda_power.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index 214468f..ed54a35 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;
 			}
 		}
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-18  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12  1:46 [PATCH] power_supply: pda_power: Complain if regulator operations fail Mark Brown
2012-06-18  4:35 ` Anton Vorontsov
  -- strict thread matches above, loose matches on Subject: below --
2012-05-07 17:21 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox