summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-04-20 01:31:42 +0000
committerMark Brown <broonie@kernel.org>2017-05-17 10:21:08 +0100
commit4c9c3d595f1bad021cc126d20879df4016801736 (patch)
tree9cf15b28be46d6399c5dade85e758b7ccca257e7 /drivers/of
parent00bab23f72100a5fd8a3030f81d0af07a859ed17 (diff)
of_graph: add of_graph_get_remote_endpoint()
It should use same method to get same result. To getting remote-endpoint node, let's use of_graph_get_remote_endpoint() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5db6aa1688e9..b169508a9b56 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2487,6 +2487,20 @@ struct device_node *of_graph_get_endpoint_by_regs(
EXPORT_SYMBOL(of_graph_get_endpoint_by_regs);
/**
+ * of_graph_get_remote_endpoint() - get remote endpoint node
+ * @node: pointer to a local endpoint device_node
+ *
+ * Return: Remote endpoint node associated with remote endpoint node linked
+ * to @node. Use of_node_put() on it when done.
+ */
+struct device_node *of_graph_get_remote_endpoint(const struct device_node *node)
+{
+ /* Get remote endpoint node. */
+ return of_parse_phandle(node, "remote-endpoint", 0);
+}
+EXPORT_SYMBOL(of_graph_get_remote_endpoint);
+
+/**
* of_graph_get_remote_port_parent() - get remote port's parent node
* @node: pointer to a local endpoint device_node
*
@@ -2500,7 +2514,7 @@ struct device_node *of_graph_get_remote_port_parent(
unsigned int depth;
/* Get remote endpoint node. */
- np = of_parse_phandle(node, "remote-endpoint", 0);
+ np = of_graph_get_remote_endpoint(node);
/* Walk 3 levels up only if there is 'ports' node. */
for (depth = 3; depth && np; depth--) {
@@ -2524,7 +2538,7 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
struct device_node *np;
/* Get remote endpoint node. */
- np = of_parse_phandle(node, "remote-endpoint", 0);
+ np = of_graph_get_remote_endpoint(node);
if (!np)
return NULL;
return of_get_next_parent(np);