Re: [PATCH 03/14] ACPI: property: Return present device nodes only on fwnode interface

Andy Shevchenko
2025-09-17T07:59:02Z

On Tue, Sep 16, 2025 at 07:01:18PM +0300, Sakari Ailus wrote:
> fwnode_graph_get_next_subnode() may return fwnode backed by ACPI device
> nodes and there has been no check these devices are present in the system,
> unlike there has been on fwnode OF backend. In order to provide consistent
> behaviour towards callers, add a check for device presence by introducing
> a new function acpi_get_next_present_subnode(), used as the
> get_next_child_node() fwnode operation that also checks device node
> presence.

...

> +/**
> + * acpi_get_next_present_subnode - Return the next present child node handle for a fwnode
> + * @fwnode: Firmware node to find the next child node for.
> + * @child: Handle to one of the device's child nodes or a null handle.
> + * Like acpi_get_next_subnode, but the device nodes returned by

acpi_get_next_subnode()

> + * acpi_get_next_present_subnode() are guaranteed to be present.
> + */

Kernel-doc validator is not happy: Missing Return section.

> +static struct fwnode_handle *
> +acpi_get_next_present_subnode(const struct fwnode_handle *fwnode,
> + struct fwnode_handle *child)
> +{
> + do {
> + child = acpi_get_next_subnode(fwnode, child);
> + } while (is_acpi_device_node(child) &&
> + !acpi_device_is_present(to_acpi_device_node(child)));
> +
> + return child;
> +}

--
With Best Regards,
Andy Shevchenko