Re: [PATCH 16/32] dmaengine: mmp_pdma: explicitly freeup irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 07/08/2016 04:48 PM, Vinod Koul wrote:
On Fri, Jul 08, 2016 at 11:54:17AM +0800, Zhangfei Gao wrote:
On 8 July 2016 at 11:51, Vinod Koul <vinod.koul@xxxxxxxxx> wrote:


sounds good to me

comitting this now:
Thanks for the patch.

Acked-by: Zhangfei Gao <zhangfei.gao@xxxxxxxxxx>


-- >8 --

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)
  static int mmp_pdma_remove(struct platform_device *op)
  {
         struct mmp_pdma_device *pdev = platform_get_drvdata(op);
+       struct mmp_pdma_phy *phy;
+       int i, irq = 0, irq_num = 0;
+
+
+       for (i = 0; i < pdev->dma_channels; i++) {
+               if (platform_get_irq(op, i) > 0)
+                       irq_num++;
+       }
+
+       if (irq_num != pdev->dma_channels) {
+               irq = platform_get_irq(op, 0);
+               devm_free_irq(&op->dev, irq, pdev);
+       } else {
+               for (i = 0; i < pdev->dma_channels; i++) {
+                       phy = &pdev->phy[i];
+                       irq = platform_get_irq(op, i);
+                       devm_free_irq(&op->dev, irq, phy);
+               }
+       }

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux