summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-04-12 08:33:50 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-04-12 08:47:17 -0700
commitc286841720b2e33795bea6cc4c71d50cd6cd8123 (patch)
tree4d53cfce50a2b1fefe7c2b7e8c2f34c3f3b2c1af /drivers/input
parent9bb9dc1359ef40a10153cd8c7106dd9d9e8aa1a3 (diff)
downloadlinux-c286841720b2e33795bea6cc4c71d50cd6cd8123.tar.gz
linux-c286841720b2e33795bea6cc4c71d50cd6cd8123.tar.bz2
linux-c286841720b2e33795bea6cc4c71d50cd6cd8123.zip
Input: imx6ul_tsc - fix error handling
If imx6ul_tsc_init() fails we should not return directly. We should disable the previously acquired clocks in this case. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/imx6ul_tsc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
index 7098e0a47019..ee82a975bfd2 100644
--- a/drivers/input/touchscreen/imx6ul_tsc.c
+++ b/drivers/input/touchscreen/imx6ul_tsc.c
@@ -337,11 +337,20 @@ static int imx6ul_tsc_open(struct input_dev *input_dev)
dev_err(tsc->dev,
"Could not prepare or enable the tsc clock: %d\n",
err);
- clk_disable_unprepare(tsc->adc_clk);
- return err;
+ goto disable_adc_clk;
}
- return imx6ul_tsc_init(tsc);
+ err = imx6ul_tsc_init(tsc);
+ if (err)
+ goto disable_tsc_clk;
+
+ return 0;
+
+disable_tsc_clk:
+ clk_disable_unprepare(tsc->tsc_clk);
+disable_adc_clk:
+ clk_disable_unprepare(tsc->adc_clk);
+ return err;
}
static void imx6ul_tsc_close(struct input_dev *input_dev)