Skip to contentSkip to conversation

Input: ads7864 - Check return value of regulator enable

PATCH New Mark Brown 1 participant 1 message Mar 2, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 Input: ads7864 - Check return value of regulator enable

At least print a warning if we can't power the device up.

---
 drivers/input/touchscreen/ads7846.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +6 -1
index 4f702b3..e0c8b7a 100644
@@ -236,7 +236,12 @@ static void __ads7846_disable(struct ads7846 *ts)
 /* Must be called with ts->lock held */
 static void __ads7846_enable(struct ads7846 *ts)
 {
-	regulator_enable(ts->reg);
+	int ret;
+
+	ret = regulator_enable(ts->reg);
+	if (ret != 0)
+		dev_err(&ts->spi->dev, "Failed to enable supply: %d\n", ret);
+
 	ads7846_restart(ts);
 }
 
Signature · 1 line
1.7.10.4