Re: [PATCH v2 8/8] device property: fix fwnode_get_next_child_node() comments

From: Rafael J. Wysocki (Intel)

Date: Fri Nov 13 2026 - 13:23:18 EST


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.
>
> While add it, fix an indefinite article in an earlier comment.

s/While add/While at/

> Fixes: 190069255582 ("device property: fix infinite loop in fwnode_for_each_child_node()")
> Cc: Xu Yang <xu.yang_2@xxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
> drivers/base/property.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 51109794d727..32df0c6724ac 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -810,7 +810,7 @@ fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
>
> /*
> * If this function is in a loop and the previous iteration returned
> - * an child from fwnode->secondary, then we need to use the secondary
> + * a child from fwnode->secondary, then we need to use the secondary
> * as parent rather than @fwnode.
> */
> if (child) {
> @@ -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?

> 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 */

> return fwnode_get_next_child_node(parent->secondary, NULL);
> }
> EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
> --