]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dmaengine: imx-sdma: explicitly freeup irq
authorVinod Koul <vinod.koul@intel.com>
Sat, 2 Jul 2016 18:30:55 +0000 (00:00 +0530)
committerVinod Koul <vinod.koul@intel.com>
Sat, 16 Jul 2016 14:49:02 +0000 (20:19 +0530)
dmaengine device should explicitly call devm_free_irq() when using
devm_request_irq().

The irq is still ON when devices remove is executed and irq should be
quiesced before remove is completed.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
drivers/dma/imx-sdma.c

index ce865f68a8c7335d1856389184733d51b0151085..18bcf556a65254de31ae3c6d5d421303ec10114a 100644 (file)
@@ -386,6 +386,7 @@ struct sdma_engine {
        const struct sdma_driver_data   *drvdata;
        u32                             spba_start_addr;
        u32                             spba_end_addr;
+       unsigned int                    irq;
 };
 
 static struct sdma_driver_data sdma_imx31 = {
@@ -1708,6 +1709,8 @@ static int sdma_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
+       sdma->irq = irq;
+
        sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL);
        if (!sdma->script_addrs)
                return -ENOMEM;
@@ -1833,6 +1836,7 @@ static int sdma_remove(struct platform_device *pdev)
        struct sdma_engine *sdma = platform_get_drvdata(pdev);
        int i;
 
+       devm_free_irq(&pdev->dev, sdma->irq, sdma);
        dma_async_device_unregister(&sdma->dma_device);
        kfree(sdma->script_addrs);
        /* Kill the tasklet */