drm/shmobile: Use simple encoder
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 5 Mar 2020 15:59:41 +0000 (16:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 2 Apr 2020 12:16:45 +0000 (14:16 +0200)
The shmobile driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-14-tzimmermann@suse.de
drivers/gpu/drm/shmobile/shmob_drm_crtc.c

index 75a752d59ef1768e890a1b8306a8e45f0a44a254..03556dbfcafbf2a68ce6d511d029e5c06493d70a 100644 (file)
@@ -17,6 +17,7 @@
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include "shmob_drm_backlight.h"
@@ -558,15 +559,6 @@ static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
        .mode_set = shmob_drm_encoder_mode_set,
 };
 
-static void shmob_drm_encoder_destroy(struct drm_encoder *encoder)
-{
-       drm_encoder_cleanup(encoder);
-}
-
-static const struct drm_encoder_funcs encoder_funcs = {
-       .destroy = shmob_drm_encoder_destroy,
-};
-
 int shmob_drm_encoder_create(struct shmob_drm_device *sdev)
 {
        struct drm_encoder *encoder = &sdev->encoder.encoder;
@@ -576,8 +568,8 @@ int shmob_drm_encoder_create(struct shmob_drm_device *sdev)
 
        encoder->possible_crtcs = 1;
 
-       ret = drm_encoder_init(sdev->ddev, encoder, &encoder_funcs,
-                              DRM_MODE_ENCODER_LVDS, NULL);
+       ret = drm_simple_encoder_init(sdev->ddev, encoder,
+                                     DRM_MODE_ENCODER_LVDS);
        if (ret < 0)
                return ret;