Commit 396852df authored by Philipp Zabel's avatar Philipp Zabel

drm/imx: imx-tve: use local encoder and connector variables

Introduce local variables for encoder and connector.
This simplifies the following commits.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8767f471
......@@ -430,27 +430,28 @@ static int tve_clk_init(struct imx_tve *tve, void __iomem *base)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment