]> www.infradead.org Git - users/jedix/linux-maple.git/commit
leds: as3645a: Use device_* to iterate over device child nodes
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Tue, 20 Aug 2024 19:02:27 +0000 (21:02 +0200)
committerLee Jones <lee@kernel.org>
Thu, 22 Aug 2024 13:48:02 +0000 (14:48 +0100)
commit77b2b4759849a9bb1cb54829f52945bad7a46919
tree4b71beb3f8cc7d95b6f766299066bd08547b6520
parent9557b4376d02088a33e5f4116bcc324d35a3b64c
leds: as3645a: Use device_* to iterate over device child nodes

Drop the manual access to the fwnode of the device to iterate over its
child nodes. `device_for_each_child_node` macro provides direct access
to the child nodes, and given that the `child` variable is only required
within the loop, the scoped variant of the macro can be used.

Use the `device_for_each_child_node_scoped` macro to iterate over the
direct child nodes of the device.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20240820-device_child_node_access-v3-2-1ee09bdedb9e@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/flash/leds-as3645a.c