Re: [PATCH v2 8/8] device property: fix fwnode_get_next_child_node() comments
From: Johan Hovold
Date: Mon Nov 16 2026 - 09:54:55 EST
On Fri, Nov 13, 2026 at 06:49:54PM +0100, Rafael J. Wysocki wrote:
> On Tue, Nov 10, 2026 at 9:52 AM Johan Hovold <johan@xxxxxxxxxx> wrote:
> >
> > The parent pointer in fwnode_get_next_child_node() may not point to a
> > primary firmware node so update the comments to reflect that.
> > @@ -822,12 +822,12 @@ fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
> > if (IS_ERR_OR_NULL(parent))
> > return NULL;
> >
> > - /* Try to find a child in primary fwnode */
> > + /* Try to find a child in parent */
>
> I'm not sure if this comment is still useful after the change, so
> maybe drop it altogether?
Sounds good.
> > next = fwnode_call_ptr_op(parent, get_next_child_node, child);
> > if (next)
> > return next;
> >
> > - /* When no more children in primary, continue with secondary */
> > + /* When no more children in parent, continue with any secondary */
>
> What about
>
> /* Direct children exhausted, go to secondary */
That works, but I think I prefer not rewriting the comment completely,
and having "any" in there to indicate that we may already be scanning a
secondary node (in which case parent->secondary is -ENODEV).
So something like:
/* When no more children, continue with any secondary node */
>
> > return fwnode_get_next_child_node(parent->secondary, NULL);
> > }
> > EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
> > --
Johan