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:

committed by
Tomi Valkeinen

parent
56c9818d5c
commit
d17eb4537a
@@ -281,19 +281,9 @@ static int sdi_init_output(struct sdi_device *sdi)
|
||||
out->bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE /* 15.5.9.1.2 */
|
||||
| DRM_BUS_FLAG_SYNC_POSEDGE;
|
||||
|
||||
out->next = omapdss_of_find_connected_device(out->dev->of_node, 1);
|
||||
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);
|
||||
|
||||
@@ -302,9 +292,8 @@ static int sdi_init_output(struct sdi_device *sdi)
|
||||
|
||||
static void sdi_uninit_output(struct sdi_device *sdi)
|
||||
{
|
||||
if (sdi->output.next)
|
||||
omapdss_device_put(sdi->output.next);
|
||||
omapdss_device_unregister(&sdi->output);
|
||||
omapdss_device_cleanup_output(&sdi->output);
|
||||
}
|
||||
|
||||
int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
|
||||
|
Reference in New Issue
Block a user