Use the devres-managed devm_of_reserved_mem_device_init() to ensure
the reserved memory region is released on device removal, fixing a
missing cleanup in the original code.

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

diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c 
b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
index bc0a63457cd7..52c3381e6766 100644
--- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
@@ -3013,7 +3013,7 @@ static int mt8195_afe_pcm_dev_probe(struct 
platform_device *pdev)
        struct reset_control *rstc;
        int i, irq_id, ret;
 
-       ret = of_reserved_mem_device_init(dev);
+       ret = devm_of_reserved_mem_device_init(dev);
        if (ret)
                return dev_err_probe(dev, ret, "failed to assign memory 
region\n");
 
-- 
2.53.0


Reply via email to