From bca75ed92a6ecd13061798c37e26026b0967ffc0 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 1 Apr 2025 11:37:05 +0200 Subject: [PATCH] drm/ofdrm: Open-code drm_simple_encoder_init() The helper drm_simple_encoder_init() is a trivial helper around drm_encoder_init() and therefore deprecated. Open-code the function and remove the dependency. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20250401094056.32904-3-tzimmermann@suse.de --- drivers/gpu/drm/tiny/ofdrm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index 7469dd281083..7d5beaf6a42c 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -21,7 +21,6 @@ #include #include #include -#include #define DRIVER_NAME "ofdrm" #define DRIVER_DESC "DRM driver for OF platform devices" @@ -999,6 +998,10 @@ static const struct drm_crtc_funcs ofdrm_crtc_funcs = { .atomic_destroy_state = ofdrm_crtc_atomic_destroy_state, }; +static const struct drm_encoder_funcs ofdrm_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static int ofdrm_connector_helper_get_modes(struct drm_connector *connector) { struct ofdrm_device *odev = ofdrm_device_of_dev(connector->dev); @@ -1309,7 +1312,7 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv, /* Encoder */ encoder = &odev->encoder; - ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_NONE); + ret = drm_encoder_init(dev, encoder, &ofdrm_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL); if (ret) return ERR_PTR(ret); encoder->possible_crtcs = drm_crtc_mask(crtc); -- 2.25.1