Commit e46e5330 authored by Maxime Ripard's avatar Maxime Ripard

drm/vc4: drv: Use managed drm_mode_config_init

Using drmm_mode_config_init instead of drm_mode_config_init allows us to
cleanup a bit the error path.
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20201029190104.2181730-2-maxime@cerno.tech
parent 1c80be48
...@@ -281,7 +281,9 @@ static int vc4_drm_bind(struct device *dev) ...@@ -281,7 +281,9 @@ static int vc4_drm_bind(struct device *dev)
if (ret) if (ret)
goto dev_put; goto dev_put;
drm_mode_config_init(drm); ret = drmm_mode_config_init(drm);
if (ret)
goto dev_put;
vc4_gem_init(drm); vc4_gem_init(drm);
...@@ -314,7 +316,6 @@ static int vc4_drm_bind(struct device *dev) ...@@ -314,7 +316,6 @@ static int vc4_drm_bind(struct device *dev)
component_unbind_all(dev, drm); component_unbind_all(dev, drm);
gem_destroy: gem_destroy:
vc4_gem_destroy(drm); vc4_gem_destroy(drm);
drm_mode_config_cleanup(drm);
dev_put: dev_put:
drm_dev_put(drm); drm_dev_put(drm);
return ret; return ret;
...@@ -329,8 +330,6 @@ static void vc4_drm_unbind(struct device *dev) ...@@ -329,8 +330,6 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_helper_shutdown(drm); drm_atomic_helper_shutdown(drm);
drm_mode_config_cleanup(drm);
drm_atomic_private_obj_fini(&vc4->load_tracker); drm_atomic_private_obj_fini(&vc4->load_tracker);
drm_atomic_private_obj_fini(&vc4->ctm_manager); drm_atomic_private_obj_fini(&vc4->ctm_manager);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment