diff mbox series

[06/17] imx/drm: parallel-display: split attach function

Message ID 20200227162125.10450-7-m.felsch@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series DRM: imx spring-cleaning | expand

Commit Message

Marco Felsch Feb. 27, 2020, 4:21 p.m. UTC
Split the maybe failing attach function from imx_pd_register() so we
can construct simple error paths later on.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/gpu/drm/imx/parallel-display.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index a05808982f2f..78703b15c7cf 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -192,6 +192,16 @@  static int imx_pd_register(struct drm_device *drm,
 				   DRM_MODE_CONNECTOR_DPI);
 	}
 
+	return 0;
+}
+static int imx_pd_attach(struct drm_device *drm,
+			 struct imx_parallel_display *imxpd,
+			 struct imx_parallel_connector *imxpc)
+{
+	struct drm_encoder *encoder = &imxpd->encoder;
+	int ret;
+
+
 	if (imxpd->panel)
 		drm_panel_attach(imxpd->panel, &imxpc->connector);
 
@@ -261,7 +271,7 @@  static int imx_pd_bind(struct device *dev, struct device *master, void *data)
 	if (ret)
 		return ret;
 
-	return 0;
+	return imx_pd_attach(drm, imxpd, imxpc);
 }
 
 static const struct component_ops imx_pd_ops = {