diff mbox

[v7,2/9] of_graph: add of_graph_get_remote_endpoint()

Message ID 87d1c7ool6.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto April 20, 2017, 1:31 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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>
---
v6 -> v7

 - no change

 drivers/of/base.c        | 18 ++++++++++++++++--
 include/linux/of_graph.h |  8 ++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

Comments

Rob Herring April 28, 2017, 7:33 p.m. UTC | #1
On Wed, Apr 19, 2017 at 8:31 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> 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>
> ---
> v6 -> v7
>
>  - no change
>
>  drivers/of/base.c        | 18 ++++++++++++++++--
>  include/linux/of_graph.h |  8 ++++++++
>  2 files changed, 24 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>
Kuninori Morimoto May 8, 2017, 1 a.m. UTC | #2
Hi Rob
Cc Mark

> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > 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>
> > ---
> > v6 -> v7
> >
> >  - no change
> >
> >  drivers/of/base.c        | 18 ++++++++++++++++--
> >  include/linux/of_graph.h |  8 ++++++++
> >  2 files changed, 24 insertions(+), 2 deletions(-)
> 
> Acked-by: Rob Herring <robh@kernel.org>

Thank you for your Acked-by.
But, does these mean, Mark (= ALSA SoC maintainer)
can pickup all OF-graph related patches ?

# I thought you will pickup OF-graph patches,
# and Mark will base on it.

Best regards
---
Kuninori Morimoto
Rob Herring May 8, 2017, 5:08 p.m. UTC | #3
On Sun, May 7, 2017 at 8:00 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> Hi Rob
> Cc Mark
>
>> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> >
>> > 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>
>> > ---
>> > v6 -> v7
>> >
>> >  - no change
>> >
>> >  drivers/of/base.c        | 18 ++++++++++++++++--
>> >  include/linux/of_graph.h |  8 ++++++++
>> >  2 files changed, 24 insertions(+), 2 deletions(-)
>>
>> Acked-by: Rob Herring <robh@kernel.org>
>
> Thank you for your Acked-by.
> But, does these mean, Mark (= ALSA SoC maintainer)
> can pickup all OF-graph related patches ?

Yes, that's usually the easiest way to deal with a series with cross
tree dependencies.

Rob
Kuninori Morimoto May 9, 2017, 12:02 a.m. UTC | #4
Hi Rob
Cc Mark

> >> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >> >
> >> > 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>
> >> > ---
(snip)
> > But, does these mean, Mark (= ALSA SoC maintainer)
> > can pickup all OF-graph related patches ?
> 
> Yes, that's usually the easiest way to deal with a series with cross
> tree dependencies.

OK, thanks !!

Best regards
---
Kuninori Morimoto
diff mbox

Patch

diff --git a/drivers/of/base.c b/drivers/of/base.c
index d9adaa9..1ae2510 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2457,6 +2457,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
  *
@@ -2470,7 +2484,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--) {
@@ -2494,7 +2508,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);
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index abdb02e..0c9473a 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -48,6 +48,8 @@  struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 					struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
+struct device_node *of_graph_get_remote_endpoint(
+					const struct device_node *node);
 struct device_node *of_graph_get_remote_port_parent(
 					const struct device_node *node);
 struct device_node *of_graph_get_remote_port(const struct device_node *node);
@@ -80,6 +82,12 @@  static inline struct device_node *of_graph_get_endpoint_by_regs(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_remote_endpoint(
+					const struct device_node *node)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_remote_port_parent(
 					const struct device_node *node)
 {