summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss/output.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-01 23:35:55 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:25 +0300
commita7e82a67c1d7b0be6c195a7c4cf2548fa873c056 (patch)
treee1e37dc662f99278c62335e6da302eaee16399b3 /drivers/gpu/drm/omapdrm/dss/output.c
parent9184f8d94c389c4712b4f393cca4a09c9e770514 (diff)
downloadlwn-a7e82a67c1d7b0be6c195a7c4cf2548fa873c056.tar.gz
lwn-a7e82a67c1d7b0be6c195a7c4cf2548fa873c056.zip
drm/omap: dss: Rework output lookup by port node
The omap_dss_find_output_by_port_node() function defined in output.c looks up an output from its port node. To do so it needs to call helper functions from dss-of.c to lookup the port parent and the port number. As omap_dss_find_output_by_port_node() is only called by omapdss_of_find_source_for_first_ep() from dss-of.c this goes back and forth between the to source files and isn't very clear. Simplify the code by passing both the parent and the port number to omap_dss_find_output_by_port_node() instead of the port node, and rename the function to omap_dss_find_output_by_port(). 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/dss/output.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/output.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
index 7f18153a1bde..be254ea42e08 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -122,27 +122,16 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)
}
EXPORT_SYMBOL(omap_dss_get_output);
-struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *port)
+struct omap_dss_device *omap_dss_find_output_by_port(struct device_node *src,
+ unsigned int port)
{
- struct device_node *src_node;
struct omap_dss_device *out;
- u32 reg;
-
- src_node = dss_of_port_get_parent_device(port);
- if (!src_node)
- return NULL;
-
- reg = dss_of_port_get_port_number(port);
list_for_each_entry(out, &output_list, output_list) {
- if (out->dev->of_node == src_node && out->port_num == reg) {
- of_node_put(src_node);
+ if (out->dev->of_node == src && out->port_num == port)
return omap_dss_get_device(out);
- }
}
- of_node_put(src_node);
-
return NULL;
}