|
@@ -573,12 +573,26 @@ err_unregister:
|
|
return ret;
|
|
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)
|
|
static int jz4740_dma_remove(struct platform_device *pdev)
|
|
{
|
|
{
|
|
struct jz4740_dma_dev *dmadev = platform_get_drvdata(pdev);
|
|
struct jz4740_dma_dev *dmadev = platform_get_drvdata(pdev);
|
|
int irq = platform_get_irq(pdev, 0);
|
|
int irq = platform_get_irq(pdev, 0);
|
|
|
|
|
|
free_irq(irq, dmadev);
|
|
free_irq(irq, dmadev);
|
|
|
|
+
|
|
|
|
+ jz4740_cleanup_vchan(&dmadev->ddev);
|
|
dma_async_device_unregister(&dmadev->ddev);
|
|
dma_async_device_unregister(&dmadev->ddev);
|
|
clk_disable_unprepare(dmadev->clk);
|
|
clk_disable_unprepare(dmadev->clk);
|
|
|
|
|