Skip to content

Commit

Permalink
Input: ads7864 - check return value of regulator enable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Dmitry Torokhov committed Mar 11, 2013
1 parent 3973501 commit f94352f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 error;

error = regulator_enable(ts->reg);
if (error != 0)
dev_err(&ts->spi->dev, "Failed to enable supply: %d\n", error);

ads7846_restart(ts);
}

Expand Down

0 comments on commit f94352f

Please sign in to comment.