dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
authorVignesh Raman <Vignesh_Raman@mentor.com>
Tue, 5 Aug 2014 13:09:42 +0000 (18:39 +0530)
committerVinod Koul <vinod.koul@intel.com>
Tue, 19 Aug 2014 15:22:05 +0000 (20:52 +0530)
Several dma drivers calls tasklet_kill() in remove function. This is done
because all running tasklets should be killed on remove. This is missing
in imx sdma driver, so adding tasklet_kill() in sdma_remove function.

Signed-off-by: Vignesh Raman <Vignesh_Raman@mentor.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/imx-sdma.c

index 40e65a4df94d56369ab3f454c4723b671de7f64c..c615e88c118a3356aaea4c4c20111e1beec6e852 100644 (file)
@@ -1645,12 +1645,19 @@ static int sdma_remove(struct platform_device *pdev)
        struct sdma_engine *sdma = platform_get_drvdata(pdev);
        struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        int irq = platform_get_irq(pdev, 0);
+       int i;
 
        dma_async_device_unregister(&sdma->dma_device);
        kfree(sdma->script_addrs);
        free_irq(irq, sdma);
        iounmap(sdma->regs);
        release_mem_region(iores->start, resource_size(iores));
+       /* Kill the tasklet */
+       for (i = 0; i < MAX_DMA_CHANNELS; i++) {
+               struct sdma_channel *sdmac = &sdma->channel[i];
+
+               tasklet_kill(&sdmac->tasklet);
+       }
        kfree(sdma);
 
        platform_set_drvdata(pdev, NULL);