summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-02 21:11:06 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:27 +0300
commiteaaedaf6a1de3be2f62feefc40fa6a711382f1ca (patch)
tree525f0e7462e3a856507650319cd66369262609b8 /drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
parent4e20bda68e01f723d7fcc4e7d55a4afc78223fb7 (diff)
downloadlinux-eaaedaf6a1de3be2f62feefc40fa6a711382f1ca.tar.bz2
drm/omap: dss: Extend omapdss_of_find_source_for_first_ep() to sinks
The omapdss_of_find_source_for_first_ep() function locates the source corresponding to the first endpoint of the first port of a device node. We can easily extend it to locate sinks as well by passing the port number as a parameter. This will be useful to find sinks in encoders drivers. Extend the function and rename it to omapdss_of_find_connected_device() to reflect its new extended purpose. Additionally, it is useful to differentiate between failures to return the connected device because no link exists in the device tree for the requested port, or because the connected device as described in the device tree is invalid or not probed yet. Return NULL in the first case and an error code in the second case, and update the callers accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c')
-rw-r--r--drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index febb20961dc5..501c47f95130 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -763,10 +763,10 @@ static int dsicm_connect(struct omap_dss_device *dssdev)
struct omap_dss_device *src;
int r;
- src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
- if (IS_ERR(src)) {
+ src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
+ if (IS_ERR_OR_NULL(src)) {
dev_err(dssdev->dev, "failed to find video source\n");
- return PTR_ERR(src);
+ return src ? PTR_ERR(src) : -EINVAL;
}
r = omapdss_device_connect(dssdev->dss, src, dssdev);