From 713165561b7e372cd21f34bfeb82188361569f74 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 6 Mar 2018 01:25:13 +0200 Subject: drm/omap: dss: Move display type validation to initialization time The display type is validated when the display is connected to the DSS output. We already have all the information we need for validation when initializing the outputs. Move validation to output initialization to simplify pipeline connection handling. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dsi.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/dss/dsi.c') diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 0e88ae1178f7..9c617e35efd1 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4890,24 +4890,13 @@ static int dsi_connect(struct omap_dss_device *src, if (r) return r; - r = omapdss_output_set_device(dst, dst->next); + r = omapdss_device_connect(dst->dss, dst, dst->next); if (r) { - DSSERR("failed to connect output to new device: %s\n", - dst->name); - goto err_mgr_disconnect; + dss_mgr_disconnect(dst); + return r; } - r = omapdss_device_connect(dst->dss, dst, dst->next); - if (r) - goto err_output_unset; - return 0; - -err_output_unset: - omapdss_output_unset_device(dst); -err_mgr_disconnect: - dss_mgr_disconnect(dst); - return r; } static void dsi_disconnect(struct omap_dss_device *src, @@ -5147,6 +5136,7 @@ static const struct component_ops dsi_component_ops = { static int dsi_init_output(struct dsi_data *dsi) { struct omap_dss_device *out = &dsi->output; + int r; out->dev = dsi->dev; out->id = dsi->module_id == 0 ? @@ -5166,6 +5156,13 @@ static int dsi_init_output(struct dsi_data *dsi) return PTR_ERR(out->next); } + r = omapdss_output_validate(out); + if (r) { + omapdss_device_put(out->next); + out->next = NULL; + return r; + } + omapdss_device_register(out); return 0; -- cgit v1.2.3