dmaengine: moxart-dma: explicitly freeup irq
authorVinod Koul <vinod.koul@intel.com>
Mon, 4 Jul 2016 10:11:25 +0000 (15:41 +0530)
committerVinod Koul <vinod.koul@intel.com>
Sat, 16 Jul 2016 14:49:03 +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: Jonas Jensen <jonas.jensen@gmail.com>
drivers/dma/moxart-dma.c

index b3a1d9a22b61d0ad2a8fc75bc9f025f61cdaa43f..a6e642792e5a34f1bb46e738e416a49cd3fcc442 100644 (file)
@@ -148,6 +148,7 @@ struct moxart_chan {
 struct moxart_dmadev {
        struct dma_device               dma_slave;
        struct moxart_chan              slave_chans[APB_DMA_MAX_CHANNEL];
+       unsigned int                    irq;
 };
 
 struct moxart_filter_data {
@@ -615,6 +616,7 @@ static int moxart_probe(struct platform_device *pdev)
                dev_err(dev, "devm_request_irq failed\n");
                return ret;
        }
+       mdc->irq = irq;
 
        ret = dma_async_device_register(&mdc->dma_slave);
        if (ret) {
@@ -638,6 +640,8 @@ static int moxart_remove(struct platform_device *pdev)
 {
        struct moxart_dmadev *m = platform_get_drvdata(pdev);
 
+       devm_free_irq(&pdev->dev, m->irq, m);
+
        dma_async_device_unregister(&m->dma_slave);
 
        if (pdev->dev.of_node)