Re: [PATCH v2 01/10] dmaengine: imx-sdma: fix missing of_dma_controller_free()

Frank Li
2025-09-12T14:39:24Z

On Thu, Sep 11, 2025 at 11:56:42PM +0200, Marco Felsch wrote:
> Add the missing of_dma_controller_free() to free the resources allocated
> via of_dma_controller_register() during probe(). The missing free was
> introduced long time ago by commit 23e118113782 ("dma: imx-sdma: use
> module_platform_driver for SDMA driver") while adding a proper .remove()
> implementation.
>
> Use the driver remove() callback to make it possible to backport this
> commit.
>
> Fixes: 23e118113782 ("dma: imx-sdma: use module_platform_driver for SDMA driver")
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> drivers/dma/imx-sdma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 02a85d6f1bea2df7d355858094c0c0b0bd07148e..3ecb917214b1268b148a29df697b780bc462afa4 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2418,6 +2418,7 @@ static void sdma_remove(struct platform_device *pdev)
> struct sdma_engine *sdma = platform_get_drvdata(pdev);
> int i;
>
> + of_dma_controller_free(sdma->dev->of_node);
> devm_free_irq(&pdev->dev, sdma->irq, sdma);
> dma_async_device_unregister(&sdma->dma_device);
> kfree(sdma->script_addrs);
>
> --
> 2.47.3
>