Skip to content

Commit c286841

Browse files
Fabio Estevamdtor
authored andcommitted
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>
1 parent 9bb9dc1 commit c286841

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

drivers/input/touchscreen/imx6ul_tsc.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,20 @@ static int imx6ul_tsc_open(struct input_dev *input_dev)
337337
dev_err(tsc->dev,
338338
"Could not prepare or enable the tsc clock: %d\n",
339339
err);
340-
clk_disable_unprepare(tsc->adc_clk);
341-
return err;
340+
goto disable_adc_clk;
342341
}
343342

344-
return imx6ul_tsc_init(tsc);
343+
err = imx6ul_tsc_init(tsc);
344+
if (err)
345+
goto disable_tsc_clk;
346+
347+
return 0;
348+
349+
disable_tsc_clk:
350+
clk_disable_unprepare(tsc->tsc_clk);
351+
disable_adc_clk:
352+
clk_disable_unprepare(tsc->adc_clk);
353+
return err;
345354
}
346355

347356
static void imx6ul_tsc_close(struct input_dev *input_dev)

0 commit comments

Comments
 (0)