Use the devres-managed devm_of_reserved_mem_device_init_by_idx() to
ensure the reserved memory region is released on device removal, fixing
a missing cleanup — the driver has no remove function.

Signed-off-by: Mukesh Ojha <[email protected]>
---
 sound/soc/fsl/imx-rpmsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index 5f1af258caf2..f504d94c4f68 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -199,7 +199,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
                goto fail;
        }
 
-       ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0);
+       ret = devm_of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0);
        if (ret)
                dev_warn(&pdev->dev, "no reserved DMA memory\n");
 
-- 
2.53.0


Reply via email to