summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorSven Van Asbroeck <thesven73@gmail.com>2019-03-10 14:58:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 19:41:19 +0200
commitf07db1f1f54ca083bac19b620745bf24503bfa88 (patch)
treedaec972ecd8c4e82402730d927e9f0e31bf46c71 /drivers/iio
parent6400212ae3b6cba121652ce89bcb19ccb4f26cc5 (diff)
downloadlinux-stable-f07db1f1f54ca083bac19b620745bf24503bfa88.tar.gz
linux-stable-f07db1f1f54ca083bac19b620745bf24503bfa88.tar.bz2
linux-stable-f07db1f1f54ca083bac19b620745bf24503bfa88.zip
iio: adc: xilinx: prevent touching unclocked h/w on remove
[ Upstream commit 2e4b88f73966adead360e47621df0183586fac32 ] In remove, the clock is disabled before canceling the delayed work. This means that the delayed work may be touching unclocked hardware. Fix by disabling the clock after the delayed work is fully canceled. This is consistent with the probe error path order. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/xilinx-xadc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 15e1a103f37d..1ae86e7359f7 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1320,8 +1320,8 @@ static int xadc_remove(struct platform_device *pdev)
iio_triggered_buffer_cleanup(indio_dev);
}
free_irq(xadc->irq, indio_dev);
- clk_disable_unprepare(xadc->clk);
cancel_delayed_work_sync(&xadc->zynq_unmask_work);
+ clk_disable_unprepare(xadc->clk);
kfree(xadc->data);
kfree(indio_dev->channels);