drm/vc4: crtc: Remove manual plane removal on error
authorMaxime Ripard <maxime@cerno.tech>
Mon, 11 Jul 2022 17:38:48 +0000 (19:38 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 13 Jul 2022 08:46:07 +0000 (10:46 +0200)
When vc4_crtc_bind() fails after vc4_crtc_init() has been called, we have
a loop undoing the plane creation and calling destroy on each plane
registered and matching the possible_crtcs mask.

However, this is redundant with what drm_mode_config_cleanup() is doing, so
let's remove it.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220711173939.1132294-19-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c

index d391e89..03a799b 100644 (file)
@@ -1317,7 +1317,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
                               IRQF_SHARED,
                               "vc4 crtc", vc4_crtc);
        if (ret)
-               goto err_destroy_planes;
+               return ret;
 
        platform_set_drvdata(pdev, vc4_crtc);
 
@@ -1325,15 +1325,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
                                 &vc4_crtc->regset);
 
        return 0;
-
-err_destroy_planes:
-       list_for_each_entry_safe(destroy_plane, temp,
-                                &drm->mode_config.plane_list, head) {
-               if (destroy_plane->possible_crtcs == drm_crtc_mask(crtc))
-                   destroy_plane->funcs->destroy(destroy_plane);
-       }
-
-       return ret;
 }
 
 static void vc4_crtc_unbind(struct device *dev, struct device *master,