drm/omap: Factor out common init/cleanup code for output devices

All the internal encoders share common init and cleanup code. Factor it
out to separate functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Laurent Pinchart
2018-09-12 19:41:31 +03:00
committed by Tomi Valkeinen
parent 56c9818d5c
commit d17eb4537a
8 changed files with 36 additions and 87 deletions

View File

@@ -671,19 +671,9 @@ static int hdmi5_init_output(struct omap_hdmi *hdmi)
out->of_ports = BIT(0);
out->ops_flags = OMAP_DSS_DEVICE_OP_EDID;
out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
if (IS_ERR(out->next)) {
if (PTR_ERR(out->next) != -EPROBE_DEFER)
dev_err(out->dev, "failed to find video sink\n");
return PTR_ERR(out->next);
}
r = omapdss_output_validate(out);
if (r) {
omapdss_device_put(out->next);
out->next = NULL;
r = omapdss_device_init_output(out);
if (r < 0)
return r;
}
omapdss_device_register(out);
@@ -694,9 +684,8 @@ static void hdmi5_uninit_output(struct omap_hdmi *hdmi)
{
struct omap_dss_device *out = &hdmi->output;
if (out->next)
omapdss_device_put(out->next);
omapdss_device_unregister(out);
omapdss_device_cleanup_output(out);
}
static int hdmi5_probe_of(struct omap_hdmi *hdmi)