Commit c2868417 authored by Fabio Estevam's avatar Fabio Estevam Committed by Dmitry Torokhov

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: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9bb9dc13
...@@ -337,11 +337,20 @@ static int imx6ul_tsc_open(struct input_dev *input_dev) ...@@ -337,11 +337,20 @@ static int imx6ul_tsc_open(struct input_dev *input_dev)
dev_err(tsc->dev, dev_err(tsc->dev,
"Could not prepare or enable the tsc clock: %d\n", "Could not prepare or enable the tsc clock: %d\n",
err); err);
clk_disable_unprepare(tsc->adc_clk); goto disable_adc_clk;
return err;
} }
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) static void imx6ul_tsc_close(struct input_dev *input_dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment