diff mbox

[2/2] Input: lpc32xx: handle clk_enable return value

Message ID 1441940576-4972-2-git-send-email-pingbo.wen@linaro.org
State New
Headers show

Commit Message

Pingbo Wen Sept. 11, 2015, 3:02 a.m. UTC
If clk_enable failed, return the err code

Signed-off-by: WEN Pingbo <pingbo.wen@linaro.org>
---
 drivers/input/touchscreen/lpc32xx_ts.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
index 24d704c..60cd31d 100644
--- a/drivers/input/touchscreen/lpc32xx_ts.c
+++ b/drivers/input/touchscreen/lpc32xx_ts.c
@@ -145,8 +145,14 @@  static void lpc32xx_stop_tsc(struct lpc32xx_tsc *tsc)
 static void lpc32xx_setup_tsc(struct lpc32xx_tsc *tsc)
 {
 	u32 tmp;
+	int retval;
 
-	clk_enable(tsc->clk);
+	retval = clk_enable(tsc->clk);
+	if (retval) {
+		dev_err(&tsc->dev->dev,
+			"clk_enable failed, ret %d\n", retval);
+		return;
+	}
 
 	tmp = tsc_readl(tsc, LPC32XX_TSC_CON) & ~LPC32XX_TSC_ADCCON_POWER_UP;