From: Souradipto Das Date: Wed, 13 May 2026 10:05:01 +0000 (+0530) Subject: drm/tegra: hdmi: Open-code drm_simple_encoder_init() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f85d5a59b3d08c117b5e9629b356bc2fbda4a5e3;p=thirdparty%2Fkernel%2Fstable.git drm/tegra: hdmi: Open-code drm_simple_encoder_init() The helper drm_simple_encoder_init() is a trivial wrapper around drm_encoder_init() that only provides a static drm_encoder_funcs with .destroy set to drm_encoder_cleanup(). Open-code the initialization with a driver-specific instance of drm_encoder_funcs and remove the dependency on drm_simple_kms_helper. Suggested-by: Thomas Zimmermann Signed-off-by: Souradipto Das [treding@nvidia.com: fix issues flagged by checkpatch] Signed-off-by: Thierry Reding Link: https://patch.msgid.link/20260513100501.6468-1-souradiptodas6@gmail.com --- diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 10f02f35c866..0d2c0ab0a63e 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -25,12 +25,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include "hda.h" #include "hdmi.h" @@ -372,6 +372,10 @@ static const struct tmds_config tegra124_tmds_config[] = { }, }; +static const struct drm_encoder_funcs tegra_hdmi_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static void tegra_hdmi_audio_lock(struct tegra_hdmi *hdmi) { mutex_lock(&hdmi->audio_lock); @@ -1555,8 +1559,8 @@ static int tegra_hdmi_init(struct host1x_client *client) hdmi->output.dev = client->dev; - drm_simple_encoder_init(drm, &hdmi->output.encoder, - DRM_MODE_ENCODER_TMDS); + drm_encoder_init(drm, &hdmi->output.encoder, &tegra_hdmi_encoder_funcs, + DRM_MODE_ENCODER_TMDS, NULL); drm_encoder_helper_add(&hdmi->output.encoder, &tegra_hdmi_encoder_helper_funcs);