|
@@ -47,7 +47,7 @@ dss_of_port_get_parent_device(struct device_node *port)
|
|
}
|
|
}
|
|
|
|
|
|
struct omap_dss_device *
|
|
struct omap_dss_device *
|
|
-omapdss_of_find_source_for_first_ep(struct device_node *node)
|
|
|
|
|
|
+omapdss_of_find_connected_device(struct device_node *node, unsigned int port)
|
|
{
|
|
{
|
|
struct device_node *src_node;
|
|
struct device_node *src_node;
|
|
struct device_node *src_port;
|
|
struct device_node *src_port;
|
|
@@ -56,27 +56,27 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
|
|
u32 port_number = 0;
|
|
u32 port_number = 0;
|
|
|
|
|
|
/* Get the endpoint... */
|
|
/* Get the endpoint... */
|
|
- ep = of_graph_get_endpoint_by_regs(node, 0, 0);
|
|
|
|
|
|
+ ep = of_graph_get_endpoint_by_regs(node, port, 0);
|
|
if (!ep)
|
|
if (!ep)
|
|
- return ERR_PTR(-EINVAL);
|
|
|
|
|
|
+ return NULL;
|
|
|
|
|
|
/* ... and its remote port... */
|
|
/* ... and its remote port... */
|
|
src_port = of_graph_get_remote_port(ep);
|
|
src_port = of_graph_get_remote_port(ep);
|
|
of_node_put(ep);
|
|
of_node_put(ep);
|
|
if (!src_port)
|
|
if (!src_port)
|
|
- return ERR_PTR(-EINVAL);
|
|
|
|
|
|
+ return NULL;
|
|
|
|
|
|
/* ... and the remote port's number and parent... */
|
|
/* ... and the remote port's number and parent... */
|
|
of_property_read_u32(src_port, "reg", &port_number);
|
|
of_property_read_u32(src_port, "reg", &port_number);
|
|
src_node = dss_of_port_get_parent_device(src_port);
|
|
src_node = dss_of_port_get_parent_device(src_port);
|
|
of_node_put(src_port);
|
|
of_node_put(src_port);
|
|
if (!src_node)
|
|
if (!src_node)
|
|
- return NULL;
|
|
|
|
|
|
+ return ERR_PTR(-EINVAL);
|
|
|
|
|
|
- /* ... and finally the source. */
|
|
|
|
|
|
+ /* ... and finally the connected device. */
|
|
src = omapdss_find_device_by_port(src_node, port_number);
|
|
src = omapdss_find_device_by_port(src_node, port_number);
|
|
of_node_put(src_node);
|
|
of_node_put(src_node);
|
|
|
|
|
|
return src ? src : ERR_PTR(-EPROBE_DEFER);
|
|
return src ? src : ERR_PTR(-EPROBE_DEFER);
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL_GPL(omapdss_of_find_source_for_first_ep);
|
|
|
|
|
|
+EXPORT_SYMBOL_GPL(omapdss_of_find_connected_device);
|