[PATCH 5.10 159/161] drm/imx: imx-tve: use local encoder and connector variables

Greg Kroah-Hartman
2026-02-04T14:51:14Z

From: Philipp Zabel <p.zabel@pengutronix.de>

[ Upstream commit 396852df02b9ff49fe256ba459605fc680fe8d89 ]

Introduce local variables for encoder and connector.
This simplifies the following commits.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Stable-dep-of: e535c23513c6 ("drm/imx/tve: fix probe device leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/imx/imx-tve.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -431,27 +431,28 @@ static int tve_clk_init(struct imx_tve *

static int imx_tve_register(struct drm_device *drm, struct imx_tve *tve)
{
+ struct drm_encoder *encoder = &tve->encoder;
+ struct drm_connector *connector = &tve->connector;
int encoder_type;
int ret;

encoder_type = tve->mode == TVE_MODE_VGA ?
DRM_MODE_ENCODER_DAC : DRM_MODE_ENCODER_TVDAC;

- ret = imx_drm_encoder_parse_of(drm, &tve->encoder, tve->dev->of_node);
+ ret = imx_drm_encoder_parse_of(drm, encoder, tve->dev->of_node);
if (ret)
return ret;

- drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs);
- drm_simple_encoder_init(drm, &tve->encoder, encoder_type);
+ drm_encoder_helper_add(encoder, &imx_tve_encoder_helper_funcs);
+ drm_simple_encoder_init(drm, encoder, encoder_type);

- drm_connector_helper_add(&tve->connector,
- &imx_tve_connector_helper_funcs);
- drm_connector_init_with_ddc(drm, &tve->connector,
+ drm_connector_helper_add(connector, &imx_tve_connector_helper_funcs);
+ drm_connector_init_with_ddc(drm, connector,
&imx_tve_connector_funcs,
DRM_MODE_CONNECTOR_VGA,
tve->ddc);

- drm_connector_attach_encoder(&tve->connector, &tve->encoder);
+ drm_connector_attach_encoder(connector, encoder);

return 0;
}