use device_for_each_child_node_scoped to access device child nodes
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected] change-id 20240725-device_child_node_access-442533910a6fVersions newest first
Changes in v3 from the cover letter
- leds-as3645a: swap the parameters in as3645a_parse_node() to have dev
at the beginning.
- Rebase onto next-20240820, drop upstreamed patches (changes for coresight-cti-platform).
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | iio: adc: xilinx-ams: use device_* to iterate over device child nodesdrivers/ | +5 | 2 replies | |
| 2/2 | leds: as3645a: use device_* to iterate over device child nodesdrivers/ | +3 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Sakari Ailus |
|---|---|
| 1/2 | |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] use device_for_each_child_node_scoped to access device child nodes
This series removes accesses to the device fwnode to iterate over its own child nodes. Using the device_for_each_child_node macro provides direct access to the device child nodes, and given that in all cases they are only required within the loop, the scoped variant of the macro can be used.
It has been stated in previous discussions [1] that device_for_each_* should be used to access device child nodes, removing the need to access its internal fwnode, and restricting fwnode_for_each_* to traversing subnodes when required.
Note that device_for_each_* implies availability, which means that after this conversion, unavailable nodes will not be accessible within the loop. The affected drivers does not seem to have any reason to iterate over unavailable nodes, though. But if someone has a case where the affected drivers might require accessing unavailable nodes, please let me know.
---
Changes in v3:
- leds-as3645a: swap the parameters in as3645a_parse_node() to have dev
at the beginning.
- Rebase onto next-20240820, drop upstreamed patches (changes for coresight-cti-platform).
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Rebase onto next-20240808, drop upstreamed patches (changes for ad7768-1)
- xilinx-ams.c: drop fwnode_device_is_available(child) (implicit in the
loop).
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Javier Carrasco (2):
iio: adc: xilinx-ams: use device_* to iterate over device child nodes
leds: as3645a: use device_* to iterate over device child nodes
drivers/iio/adc/xilinx-ams.c | 15 +++++---------- drivers/leds/flash/leds-as3645a.c | 8 +++----- 2 files changed, 8 insertions(+), 15 deletions(-)
---
base-commit: bb1b0acdcd66e0d8eedee3570d249e076b89ab32
change-id: 20240725-device_child_node_access-442533910a6f
Best regards,
Signature · 1 line
Javier Carrasco <[email protected]>