浏览代码

Input: ads7864 - check return value of regulator enable

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

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Mark Brown 12 年之前
父节点
当前提交
f94352f8db
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      drivers/input/touchscreen/ads7846.c

+ 6 - 1
drivers/input/touchscreen/ads7846.c

@@ -236,7 +236,12 @@ static void __ads7846_disable(struct ads7846 *ts)
 /* Must be called with ts->lock held */
 /* Must be called with ts->lock held */
 static void __ads7846_enable(struct ads7846 *ts)
 static void __ads7846_enable(struct ads7846 *ts)
 {
 {
-	regulator_enable(ts->reg);
+	int error;
+
+	error = regulator_enable(ts->reg);
+	if (error != 0)
+		dev_err(&ts->spi->dev, "Failed to enable supply: %d\n", error);
+
 	ads7846_restart(ts);
 	ads7846_restart(ts);
 }
 }