drm/vkms: Use drmm_crtc_init_with_planes()
authorMaíra Canal <mcanal@igalia.com>
Mon, 16 Jan 2023 20:58:00 +0000 (17:58 -0300)
committerMaíra Canal <mairacanal@riseup.net>
Wed, 12 Apr 2023 13:38:33 +0000 (10:38 -0300)
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes()
to get rid of the explicit destroy hook in struct drm_crtc_funcs.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230116205800.1266227-1-mcanal@igalia.com
drivers/gpu/drm/vkms/vkms_crtc.c

index 57bbd32..515f677 100644 (file)
@@ -161,7 +161,6 @@ static void vkms_atomic_crtc_reset(struct drm_crtc *crtc)
 
 static const struct drm_crtc_funcs vkms_crtc_funcs = {
        .set_config             = drm_atomic_helper_set_config,
-       .destroy                = drm_crtc_cleanup,
        .page_flip              = drm_atomic_helper_page_flip,
        .reset                  = vkms_atomic_crtc_reset,
        .atomic_duplicate_state = vkms_atomic_crtc_duplicate_state,
@@ -282,8 +281,8 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
        struct vkms_output *vkms_out = drm_crtc_to_vkms_output(crtc);
        int ret;
 
-       ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor,
-                                       &vkms_crtc_funcs, NULL);
+       ret = drmm_crtc_init_with_planes(dev, crtc, primary, cursor,
+                                        &vkms_crtc_funcs, NULL);
        if (ret) {
                DRM_ERROR("Failed to init CRTC\n");
                return ret;