Commit 5145fe5b authored by Philipp Zabel's avatar Philipp Zabel

drm/imx: parallel-display: use local bridge and connector variables

Use local variables for bridge 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 e2127db8
...@@ -256,7 +256,9 @@ static const struct drm_bridge_funcs imx_pd_bridge_funcs = { ...@@ -256,7 +256,9 @@ static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
static int imx_pd_register(struct drm_device *drm, static int imx_pd_register(struct drm_device *drm,
struct imx_parallel_display *imxpd) struct imx_parallel_display *imxpd)
{ {
struct drm_connector *connector = &imxpd->connector;
struct drm_encoder *encoder = &imxpd->encoder; struct drm_encoder *encoder = &imxpd->encoder;
struct drm_bridge *bridge = &imxpd->bridge;
int ret; int ret;
ret = imx_drm_encoder_parse_of(drm, encoder, imxpd->dev->of_node); ret = imx_drm_encoder_parse_of(drm, encoder, imxpd->dev->of_node);
...@@ -268,31 +270,29 @@ static int imx_pd_register(struct drm_device *drm, ...@@ -268,31 +270,29 @@ static int imx_pd_register(struct drm_device *drm,
* immediately since the current state is ON * immediately since the current state is ON
* at this point. * at this point.
*/ */
imxpd->connector.dpms = DRM_MODE_DPMS_OFF; connector->dpms = DRM_MODE_DPMS_OFF;
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE); drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE);
imxpd->bridge.funcs = &imx_pd_bridge_funcs; bridge->funcs = &imx_pd_bridge_funcs;
drm_bridge_attach(encoder, &imxpd->bridge, NULL, 0); drm_bridge_attach(encoder, bridge, NULL, 0);
if (!imxpd->next_bridge) { if (!imxpd->next_bridge) {
drm_connector_helper_add(&imxpd->connector, drm_connector_helper_add(connector,
&imx_pd_connector_helper_funcs); &imx_pd_connector_helper_funcs);
drm_connector_init(drm, &imxpd->connector, drm_connector_init(drm, connector, &imx_pd_connector_funcs,
&imx_pd_connector_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
} }
if (imxpd->next_bridge) { if (imxpd->next_bridge) {
ret = drm_bridge_attach(encoder, imxpd->next_bridge, ret = drm_bridge_attach(encoder, imxpd->next_bridge, bridge, 0);
&imxpd->bridge, 0);
if (ret < 0) { if (ret < 0) {
dev_err(imxpd->dev, "failed to attach bridge: %d\n", dev_err(imxpd->dev, "failed to attach bridge: %d\n",
ret); ret);
return ret; return ret;
} }
} else { } else {
drm_connector_attach_encoder(&imxpd->connector, encoder); drm_connector_attach_encoder(connector, encoder);
} }
return 0; 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