Re: [PATCH 01/14] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only

Sakari Ailus
2025-09-17T11:50:20Z

Hi Andy,

Thank you for the review.

On Wed, Sep 17, 2025 at 10:17:42AM +0300, Andy Shevchenko wrote:
> On Tue, Sep 16, 2025 at 07:01:16PM +0300, Sakari Ailus wrote:
> > Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> > property API is somewhat problematic as the latter is used in the
> > impelementation of the former. Instead of using
> > fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> > acpi_get_next_subnode() directly instead.
>
> ...
>
> > - endpoint = fwnode_get_next_child_node(port, prev);
> > + endpoint = acpi_get_next_subnode(port, prev);
> > while (!endpoint) {
> > - port = fwnode_get_next_child_node(fwnode, port);
> > + port = acpi_get_next_subnode(fwnode, port);
> > if (!port)
> > break;
> > if (is_acpi_graph_node(port, "port"))
> > - endpoint = fwnode_get_next_child_node(port, NULL);
> > + endpoint = acpi_get_next_subnode(port, NULL);
> > }
>
> Can this be refactored to
>
> do {
> endpoint = acpi_get_next_subnode(port, prev);
> if (endpoint)
> break;
>
> port = acpi_get_next_subnode(fwnode, port);
> if (is_acpi_graph_node(port, "port"))
> prev = NULL;
> } while (port);
>
> (but it might be a material for further cleanups)?

I think the above should work. I'd also do the change after this set.

--
Kind regards,

Sakari Ailus