Commit 30df23c5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov

Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()

If imx6ul_tsc_init() fails then we need to clean up the clocks.

I reversed the "if (input_dev->users) {" condition to make the code a
bit simpler.

Fixes: 6cc527b0 ("Input: imx6ul_tsc - propagate the errors")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200905124942.GC183976@mwandaSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 93f63406
...@@ -530,7 +530,9 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev) ...@@ -530,7 +530,9 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
mutex_lock(&input_dev->mutex); mutex_lock(&input_dev->mutex);
if (input_dev->users) { if (!input_dev->users)
goto out;
retval = clk_prepare_enable(tsc->adc_clk); retval = clk_prepare_enable(tsc->adc_clk);
if (retval) if (retval)
goto out; goto out;
...@@ -542,8 +544,11 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev) ...@@ -542,8 +544,11 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
} }
retval = imx6ul_tsc_init(tsc); retval = imx6ul_tsc_init(tsc);
if (retval) {
clk_disable_unprepare(tsc->tsc_clk);
clk_disable_unprepare(tsc->adc_clk);
goto out;
} }
out: out:
mutex_unlock(&input_dev->mutex); mutex_unlock(&input_dev->mutex);
return retval; return retval;
......
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