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/gpu/drm/sun4i/sun4i_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 8a409eee1dca..5ca7b6f4764b 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -80,7 +80,7 @@ static int sun4i_drv_bind(struct device *dev) INIT_LIST_HEAD(&drv->engine_list); INIT_LIST_HEAD(&drv->tcon_list); - ret = of_reserved_mem_device_init(dev); + ret = devm_of_reserved_mem_device_init(dev); if (ret && ret != -ENODEV) { dev_err(drm->dev, "Couldn't claim our memory region\n"); goto free_drm; @@ -125,7 +125,6 @@ static int sun4i_drv_bind(struct device *dev) component_unbind_all(dev, NULL); cleanup_mode_config: drm_mode_config_cleanup(drm); - of_reserved_mem_device_release(dev); free_drm: drm_dev_put(drm); return ret; @@ -142,7 +141,6 @@ static void sun4i_drv_unbind(struct device *dev) drm_mode_config_cleanup(drm); component_unbind_all(dev, NULL); - of_reserved_mem_device_release(dev); drm_dev_put(drm); } -- 2.53.0

