mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()
[ Upstream commit30df23c5ec] 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:6cc527b058("Input: imx6ul_tsc - propagate the errors") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200905124942.GC183976@mwanda Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
af74b4a25f
commit
2a0ffcfe9f
@@ -538,20 +538,25 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
|
||||
|
||||
mutex_lock(&input_dev->mutex);
|
||||
|
||||
if (input_dev->users) {
|
||||
retval = clk_prepare_enable(tsc->adc_clk);
|
||||
if (retval)
|
||||
goto out;
|
||||
if (!input_dev->users)
|
||||
goto out;
|
||||
|
||||
retval = clk_prepare_enable(tsc->tsc_clk);
|
||||
if (retval) {
|
||||
clk_disable_unprepare(tsc->adc_clk);
|
||||
goto out;
|
||||
}
|
||||
retval = clk_prepare_enable(tsc->adc_clk);
|
||||
if (retval)
|
||||
goto out;
|
||||
|
||||
retval = imx6ul_tsc_init(tsc);
|
||||
retval = clk_prepare_enable(tsc->tsc_clk);
|
||||
if (retval) {
|
||||
clk_disable_unprepare(tsc->adc_clk);
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = imx6ul_tsc_init(tsc);
|
||||
if (retval) {
|
||||
clk_disable_unprepare(tsc->tsc_clk);
|
||||
clk_disable_unprepare(tsc->adc_clk);
|
||||
goto out;
|
||||
}
|
||||
out:
|
||||
mutex_unlock(&input_dev->mutex);
|
||||
return retval;
|
||||
|
||||
Reference in New Issue
Block a user