Use the devres-managed devm_of_reserved_mem_device_init() instead of
the manual of_reserved_mem_device_init()/of_reserved_mem_device_release()
pair, letting the device resource manager handle cleanup automatically.

Signed-off-by: Mukesh Ojha <[email protected]>
---
 drivers/media/platform/mediatek/vpu/mtk_vpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.c 
b/drivers/media/platform/mediatek/vpu/mtk_vpu.c
index 8d8319f0cd22..557bffb2c2f1 100644
--- a/drivers/media/platform/mediatek/vpu/mtk_vpu.c
+++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.c
@@ -888,7 +888,7 @@ static int mtk_vpu_probe(struct platform_device *pdev)
        dev_info(dev, "4GB mode %u\n", vpu->enable_4GB);
 
        if (vpu->enable_4GB) {
-               ret = of_reserved_mem_device_init(dev);
+               ret = devm_of_reserved_mem_device_init(dev);
                if (ret)
                        dev_info(dev, "init reserved memory failed\n");
                        /* continue to use dynamic allocation if failed */
@@ -930,7 +930,6 @@ static int mtk_vpu_probe(struct platform_device *pdev)
 free_d_mem:
        vpu_free_ext_mem(vpu, D_FW);
 remove_debugfs:
-       of_reserved_mem_device_release(dev);
 #ifdef CONFIG_DEBUG_FS
        debugfs_remove(vpu_debugfs);
 #endif
-- 
2.53.0


Reply via email to