* [PATCH] of: property: Fix the semantics of of_is_ancestor_of()
@ 2019-11-20 8:02 Saravana Kannan
2019-11-20 15:36 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Saravana Kannan @ 2019-11-20 8:02 UTC (permalink / raw)
To: Rob Herring, Frank Rowand
Cc: Saravana Kannan, Greg Kroah-Hartman, kernel-team, devicetree,
linux-kernel
The of_is_ancestor_of() function was renamed from of_link_is_valid()
based on review feedback. The rename meant the semantics of the function
had to be inverted, but this was missed in the earlier patch.
So, fix the semantics of of_is_ancestor_of() and invert the conditional
expressions where it is used.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/of/property.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index dedbf82da838..0de1e7e69b6e 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -993,11 +993,11 @@ static bool of_is_ancestor_of(struct device_node *test_ancestor,
while (child) {
if (child == test_ancestor) {
of_node_put(child);
- return false;
+ return true;
}
child = of_get_next_parent(child);
}
- return true;
+ return false;
}
/**
@@ -1043,7 +1043,7 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np,
* descendant nodes. By definition, a child node can't be a functional
* dependency for the parent node.
*/
- if (!of_is_ancestor_of(dev->of_node, sup_np)) {
+ if (of_is_ancestor_of(dev->of_node, sup_np)) {
dev_dbg(dev, "Not linking to %pOFP - is descendant\n", sup_np);
of_node_put(sup_np);
return -EINVAL;
--
2.24.0.432.g9d3f5f5b63-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] of: property: Fix the semantics of of_is_ancestor_of()
2019-11-20 8:02 [PATCH] of: property: Fix the semantics of of_is_ancestor_of() Saravana Kannan
@ 2019-11-20 15:36 ` Greg Kroah-Hartman
2019-11-20 21:50 ` Saravana Kannan
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-20 15:36 UTC (permalink / raw)
To: Saravana Kannan
Cc: Rob Herring, Frank Rowand, kernel-team, devicetree, linux-kernel
On Wed, Nov 20, 2019 at 12:02:29AM -0800, Saravana Kannan wrote:
> The of_is_ancestor_of() function was renamed from of_link_is_valid()
> based on review feedback. The rename meant the semantics of the function
> had to be inverted, but this was missed in the earlier patch.
>
> So, fix the semantics of of_is_ancestor_of() and invert the conditional
> expressions where it is used.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> drivers/of/property.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
What git commit does this patch fix?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] of: property: Fix the semantics of of_is_ancestor_of()
2019-11-20 15:36 ` Greg Kroah-Hartman
@ 2019-11-20 21:50 ` Saravana Kannan
2019-11-21 12:00 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Saravana Kannan @ 2019-11-20 21:50 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Rob Herring, Frank Rowand, Android Kernel Team,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML
On Wed, Nov 20, 2019 at 7:36 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Nov 20, 2019 at 12:02:29AM -0800, Saravana Kannan wrote:
> > The of_is_ancestor_of() function was renamed from of_link_is_valid()
> > based on review feedback. The rename meant the semantics of the function
> > had to be inverted, but this was missed in the earlier patch.
> >
> > So, fix the semantics of of_is_ancestor_of() and invert the conditional
> > expressions where it is used.
> >
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > ---
> > drivers/of/property.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
> What git commit does this patch fix?
>
Fixes commit a3e1d1a7f5fcc. Let me know if you want me to send a v2 or
if you can fix up the commit text on your end.
Thanks,
Saravana
-Saravana
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] of: property: Fix the semantics of of_is_ancestor_of()
2019-11-20 21:50 ` Saravana Kannan
@ 2019-11-21 12:00 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-21 12:00 UTC (permalink / raw)
To: Saravana Kannan
Cc: Rob Herring, Frank Rowand, Android Kernel Team,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML
On Wed, Nov 20, 2019 at 01:50:42PM -0800, Saravana Kannan wrote:
> On Wed, Nov 20, 2019 at 7:36 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Nov 20, 2019 at 12:02:29AM -0800, Saravana Kannan wrote:
> > > The of_is_ancestor_of() function was renamed from of_link_is_valid()
> > > based on review feedback. The rename meant the semantics of the function
> > > had to be inverted, but this was missed in the earlier patch.
> > >
> > > So, fix the semantics of of_is_ancestor_of() and invert the conditional
> > > expressions where it is used.
> > >
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > > ---
> > > drivers/of/property.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > What git commit does this patch fix?
> >
>
> Fixes commit a3e1d1a7f5fcc. Let me know if you want me to send a v2 or
> if you can fix up the commit text on your end.
I'll fix it up.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-21 12:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 8:02 [PATCH] of: property: Fix the semantics of of_is_ancestor_of() Saravana Kannan
2019-11-20 15:36 ` Greg Kroah-Hartman
2019-11-20 21:50 ` Saravana Kannan
2019-11-21 12:00 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).