From patchwork Sat Mar 2 07:04:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 2206211 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D7D513FCF2 for ; Sat, 2 Mar 2013 07:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750835Ab3CBHqE (ORCPT ); Sat, 2 Mar 2013 02:46:04 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:42104 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819Ab3CBHqD (ORCPT ); Sat, 2 Mar 2013 02:46:03 -0500 Received: from finisterre.wolfsonmicro.main (unknown [1.203.5.31]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 09FD37503C2; Sat, 2 Mar 2013 07:46:01 +0000 (GMT) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.80) (envelope-from ) id 1UBgUu-0006Zx-9X; Sat, 02 Mar 2013 15:04:44 +0800 From: Mark Brown To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Mark Brown Subject: [PATCH] Input: ads7864 - Check return value of regulator enable Date: Sat, 2 Mar 2013 15:04:41 +0800 Message-Id: <1362207881-25259-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org At least print a warning if we can't power the device up. Signed-off-by: Mark Brown --- drivers/input/touchscreen/ads7846.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 4f702b3..e0c8b7a 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 ret; + + ret = regulator_enable(ts->reg); + if (ret != 0) + dev_err(&ts->spi->dev, "Failed to enable supply: %d\n", ret); + ads7846_restart(ts); }