aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-07-04 06:31:18 -0400
committerVinod Koul <vinod.koul@intel.com>2016-07-16 10:49:04 -0400
commit84c610ba5476b6c38ef8e6bc834993bb38cf1208 (patch)
treec18d77cbd83389184a266809b540ba22efd73893
parent144fa37f5b4f9b81dfab79c8d440b4aba8b07fde (diff)
dmaengine: nbpfaxi: explicitly freeup irq
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: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
-rw-r--r--drivers/dma/nbpfaxi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 9f0e98b75eb9..f489f4e3429f 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -227,6 +227,7 @@ struct nbpf_device {
227 void __iomem *base; 227 void __iomem *base;
228 struct clk *clk; 228 struct clk *clk;
229 const struct nbpf_config *config; 229 const struct nbpf_config *config;
230 unsigned int eirq;
230 struct nbpf_channel chan[]; 231 struct nbpf_channel chan[];
231}; 232};
232 233
@@ -1375,6 +1376,7 @@ static int nbpf_probe(struct platform_device *pdev)
1375 IRQF_SHARED, "dma error", nbpf); 1376 IRQF_SHARED, "dma error", nbpf);
1376 if (ret < 0) 1377 if (ret < 0)
1377 return ret; 1378 return ret;
1379 nbpf->eirq = eirq;
1378 1380
1379 INIT_LIST_HEAD(&dma_dev->channels); 1381 INIT_LIST_HEAD(&dma_dev->channels);
1380 1382
@@ -1446,6 +1448,15 @@ e_clk_off:
1446static int nbpf_remove(struct platform_device *pdev) 1448static int nbpf_remove(struct platform_device *pdev)
1447{ 1449{
1448 struct nbpf_device *nbpf = platform_get_drvdata(pdev); 1450 struct nbpf_device *nbpf = platform_get_drvdata(pdev);
1451 int i;
1452
1453 devm_free_irq(&pdev->dev, nbpf->eirq, nbpf);
1454
1455 for (i = 0; i < nbpf->config->num_channels; i++) {
1456 struct nbpf_channel *chan = nbpf->chan + i;
1457
1458 devm_free_irq(&pdev->dev, chan->irq, chan);
1459 }
1449 1460
1450 of_dma_controller_free(pdev->dev.of_node); 1461 of_dma_controller_free(pdev->dev.of_node);
1451 dma_async_device_unregister(&nbpf->dma_dev); 1462 dma_async_device_unregister(&nbpf->dma_dev);