Thread (18 messages) 18 messages, 5 authors, 2024-08-05

Re: [PATCH v2 2/6] hwmon: (ltc2992) use device_for_each_child_node_scoped() to access child nodes

From: Guenter Roeck <linux@roeck-us.net>
Date: 2024-07-21 18:23:01
Also in: linux-acpi, linux-hwmon, linux-leds, lkml

On Sun, Jul 21, 2024 at 05:19:02PM +0200, Javier Carrasco wrote:
The iterated nodes are direct children of the device node, and the
`device_for_each_child_node()` macro accounts for child node
availability.

`fwnode_for_each_available_child_node()` is meant to access the child
nodes of an fwnode, and therefore not direct child nodes of the device
node.

In this case, the child nodes are not required outside the loop, and
the scoped version of the macro can be used to remove the repetitive
`goto put` pattern.

Use `device_for_each_child_node_scoped_scoped()` to indicate device's
direct child nodes.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied.

Thanks,
Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help