dmaengine: mmp_pdma: add missed of_dma_controller_free
authorChuhong Yuan <hslester96@gmail.com>
Fri, 15 Nov 2019 08:31:53 +0000 (16:31 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 22 Nov 2019 05:21:30 +0000 (10:51 +0530)
The driver calls of_dma_controller_register in probe but does not free
it in remove.
Add the call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20191115083153.12334-1-hslester96@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/mmp_pdma.c

index 7fe494fc50d4eb3935486b3d77b48f47d21c82ff..ad06f260e907d6c279e81c3cd65ae448e09049d8 100644 (file)
@@ -945,6 +945,8 @@ static int mmp_pdma_remove(struct platform_device *op)
        struct mmp_pdma_phy *phy;
        int i, irq = 0, irq_num = 0;
 
+       if (op->dev.of_node)
+               of_dma_controller_free(op->dev.of_node);
 
        for (i = 0; i < pdev->dma_channels; i++) {
                if (platform_get_irq(op, i) > 0)