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/sof/mediatek/mt8195/mt8195.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c 
b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 4d6e9300a9c0..e4b6b6c18e02 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -49,7 +49,7 @@ static int platform_parse_resource(struct platform_device 
*pdev, void *data)
        struct mtk_adsp_chip_info *adsp = data;
        int ret;
 
-       ret = of_reserved_mem_device_init(dev);
+       ret = devm_of_reserved_mem_device_init(dev);
        if (ret) {
                dev_err(dev, "of_reserved_mem_device_init failed\n");
                return ret;
-- 
2.53.0


Reply via email to