From: Mark Brown Date: Mon, 4 Mar 2013 04:19:07 +0000 (-0800) Subject: Input: ads7864 - check return value of regulator enable X-Git-Tag: v3.9~24^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f94352f8db97b9a3b3c1ec45f6fef1400880168a;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 4f702b3..434c3df 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -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); }