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

Marco Felsch m.felsch at pengutronix.de
Thu Feb 27 16:21:14 UTC 2020


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 at pengutronix.de>
---
 drivers/gpu/drm/imx/parallel-display.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

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 = {
-- 
2.20.1



More information about the dri-devel mailing list