Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae9c02b4 authored by Alex Smith's avatar Alex Smith Committed by Vinod Koul
Browse files

dmaengine: jz4780: Kill tasklets before unregistering the device



Tasklets may have been scheduled as a result of an earlier interrupt
that could still be running. Kill them before unregistering the
device.

Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent d509a83c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -866,9 +866,15 @@ static int jz4780_dma_probe(struct platform_device *pdev)
static int jz4780_dma_remove(struct platform_device *pdev)
{
	struct jz4780_dma_dev *jzdma = platform_get_drvdata(pdev);
	int i;

	of_dma_controller_free(pdev->dev.of_node);

	free_irq(jzdma->irq, jzdma);

	for (i = 0; i < JZ_DMA_NR_CHANNELS; i++)
		tasklet_kill(&jzdma->chan[i].vchan.task);

	dma_async_device_unregister(&jzdma->dma_device);
	return 0;
}