diff options
author | Vinod Koul <vinod.koul@intel.com> | 2016-07-02 12:18:02 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-07-16 17:49:00 +0300 |
commit | cec9cfa8d88c8b2ad0789e8441ff98c3f52b8142 (patch) | |
tree | d5f3cef5c52641b88934074b2ec14fb26748f494 /drivers/dma | |
parent | f950f025364ad3ad4834cd1058737f272b2cc665 (diff) | |
download | linux-cec9cfa8d88c8b2ad0789e8441ff98c3f52b8142.tar.xz |
dmaengine: jz4740: kill the tasklets upon exit
drivers should ensure that tasklets are killed, so that they can't be
executed after driver remove is executed, so ensure they are killed.
This driver used vchan tasklets, so those need to be killed.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dma-jz4740.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c index 7638b24ce8d0..9689b36c005a 100644 --- a/drivers/dma/dma-jz4740.c +++ b/drivers/dma/dma-jz4740.c @@ -573,12 +573,26 @@ err_unregister: return ret; } +static void jz4740_cleanup_vchan(struct dma_device *dmadev) +{ + struct jz4740_dmaengine_chan *chan, *_chan; + + list_for_each_entry_safe(chan, _chan, + &dmadev->channels, vchan.chan.device_node) { + list_del(&chan->vchan.chan.device_node); + tasklet_kill(&chan->vchan.task); + } +} + + static int jz4740_dma_remove(struct platform_device *pdev) { struct jz4740_dma_dev *dmadev = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); free_irq(irq, dmadev); + + jz4740_cleanup_vchan(&dmadev->ddev); dma_async_device_unregister(&dmadev->ddev); clk_disable_unprepare(dmadev->clk); |