linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] use device_for_each_child_node_scoped to access device child nodes
@ 2024-08-01  6:13 Javier Carrasco
  2024-08-01  6:13 ` [PATCH 1/4] coresight: cti: use device_* to iterate over " Javier Carrasco
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Javier Carrasco @ 2024-08-01  6:13 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
	Anand Ashok Dumbre, Michal Simek, Sakari Ailus, Pavel Machek,
	Lee Jones
  Cc: coresight, linux-arm-kernel, linux-kernel, linux-iio, linux-leds,
	Javier Carrasco

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.

Link: https://lore.kernel.org/linux-hwmon/cffb5885-3cbc-480c-ab6d-4a442d1afb8a@gmail.com/ [1]
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Javier Carrasco (4):
      coresight: cti: use device_* to iterate over device child nodes
      iio: adc: ad7768-1: use device_* to iterate over device child nodes
      iio: adc: xilinx-ams: use device_* to iterate over device child nodes
      leds: as3645a: use device_* to iterate over device child nodes

 drivers/hwtracing/coresight/coresight-cti-platform.c | 10 +++-------
 drivers/iio/adc/ad7768-1.c                           |  5 +----
 drivers/iio/adc/xilinx-ams.c                         |  7 ++-----
 drivers/leds/flash/leds-as3645a.c                    |  8 +++-----
 4 files changed, 9 insertions(+), 21 deletions(-)
---
base-commit: cd19ac2f903276b820f5d0d89de0c896c27036ed
change-id: 20240725-device_child_node_access-442533910a6f

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-05 20:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01  6:13 [PATCH 0/4] use device_for_each_child_node_scoped to access device child nodes Javier Carrasco
2024-08-01  6:13 ` [PATCH 1/4] coresight: cti: use device_* to iterate over " Javier Carrasco
2024-08-01  9:20   ` Suzuki K Poulose
2024-08-01 10:37     ` Javier Carrasco
2024-08-02  7:50       ` Suzuki K Poulose
2024-08-01  6:13 ` [PATCH 2/4] iio: adc: ad7768-1: " Javier Carrasco
2024-08-01  7:31   ` Nuno Sá
2024-08-03 11:17     ` Jonathan Cameron
2024-08-01  6:13 ` [PATCH 3/4] iio: adc: xilinx-ams: " Javier Carrasco
2024-08-03 11:17   ` Jonathan Cameron
2024-08-01  6:13 ` [PATCH 4/4] leds: as3645a: " Javier Carrasco
2024-08-05 20:58   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).