summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2020-10-29 22:01:00 +0300
committerMaxime Ripard <maxime@cerno.tech>2020-11-02 14:12:07 +0300
commite46e5330d13de67de5b614c5021730e9709de975 (patch)
treec8d6fb7abece67664c7779ef62a2c8dcc0e1b4d1
parent1c80be48c70a2198f7cf04a546b3805b92293ac6 (diff)
downloadlinux-e46e5330d13de67de5b614c5021730e9709de975.tar.xz
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: Maxime Ripard <maxime@cerno.tech> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201029190104.2181730-2-maxime@cerno.tech
-rw-r--r--drivers/gpu/drm/vc4/vc4_drv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index fad1d7c88cde..44209077000d 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -281,7 +281,9 @@ static int vc4_drm_bind(struct device *dev)
if (ret)
goto dev_put;
- drm_mode_config_init(drm);
+ ret = drmm_mode_config_init(drm);
+ if (ret)
+ goto dev_put;
vc4_gem_init(drm);
@@ -314,7 +316,6 @@ unbind_all:
component_unbind_all(dev, drm);
gem_destroy:
vc4_gem_destroy(drm);
- drm_mode_config_cleanup(drm);
dev_put:
drm_dev_put(drm);
return ret;
@@ -329,8 +330,6 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_helper_shutdown(drm);
- drm_mode_config_cleanup(drm);
-
drm_atomic_private_obj_fini(&vc4->load_tracker);
drm_atomic_private_obj_fini(&vc4->ctm_manager);