summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSven Van Asbroeck <thesven73@gmail.com>2019-03-10 21:58:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 20:40:12 +0300
commita9189a36d66ea1f60e279641a3a53d51b0b5ca82 (patch)
tree203531aa5a0736338e54c4111170175e15f1fb8d /drivers
parent1fc0aeddc0b7490e2fbfb688f66e3c8dc6b5c2d1 (diff)
downloadlinux-a9189a36d66ea1f60e279641a3a53d51b0b5ca82.tar.xz
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')
-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);