diff options
author | Vinod Koul <vinod.koul@intel.com> | 2016-07-04 05:45:26 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-07-16 10:49:03 -0400 |
commit | a46018929b35f551e29302a89de5ef20c1cfd4f8 (patch) | |
tree | 7c7934f657fb0392de654250ffc89b2379186eb1 /drivers/dma | |
parent | 486b10a255f70735585c90d334422da65dfe43ac (diff) |
dmaengine: mmp_pdma: 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>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/mmp_pdma.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 56f1fd68b620..f4b25fb0d040 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c | |||
@@ -931,6 +931,25 @@ static void dma_do_tasklet(unsigned long data) | |||
931 | static int mmp_pdma_remove(struct platform_device *op) | 931 | static int mmp_pdma_remove(struct platform_device *op) |
932 | { | 932 | { |
933 | struct mmp_pdma_device *pdev = platform_get_drvdata(op); | 933 | struct mmp_pdma_device *pdev = platform_get_drvdata(op); |
934 | struct mmp_pdma_phy *phy; | ||
935 | int i, irq = 0, irq_num = 0; | ||
936 | |||
937 | |||
938 | for (i = 0; i < pdev->dma_channels; i++) { | ||
939 | if (platform_get_irq(op, i) > 0) | ||
940 | irq_num++; | ||
941 | } | ||
942 | |||
943 | if (irq_num != pdev->dma_channels) { | ||
944 | irq = platform_get_irq(op, 0); | ||
945 | devm_free_irq(&op->dev, irq, pdev); | ||
946 | } else { | ||
947 | for (i = 0; i < pdev->dma_channels; i++) { | ||
948 | phy = &pdev->phy[i]; | ||
949 | irq = platform_get_irq(op, i); | ||
950 | devm_free_irq(&op->dev, irq, phy); | ||
951 | } | ||
952 | } | ||
934 | 953 | ||
935 | dma_async_device_unregister(&pdev->device); | 954 | dma_async_device_unregister(&pdev->device); |
936 | return 0; | 955 | return 0; |