mirror-linux/drivers/base
Matti Vaittinen f243036314 property: Add functions to iterate named child
There are a few use-cases where child nodes with a specific name need to
be parsed. Code like:

fwnode_for_each_child_node()
	if (fwnode_name_eq())
		...

can be found from a various drivers/subsystems. Adding a macro for this
can simplify things a bit.

In a few cases the data from the found nodes is later added to an array,
which is allocated based on the number of found nodes. One example of
such use is the IIO subsystem's ADC channel nodes, where the relevant
nodes are named as channel[@N].

Add helpers for iterating and counting device's sub-nodes with certain
name instead of open-coding this in every user.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://patch.msgid.link/2767173b7b18e974c0bac244688214bd3863ff06.1742560649.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22 19:09:52 +01:00
..
firmware_loader Summary: 2025-01-29 10:35:40 -08:00
power treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
regmap regmap: Updates for v6.15 2025-03-29 14:31:39 -07:00
test drivers: base: test: Add ...find_device_by...(... NULL) tests 2024-12-24 09:48:09 +01:00
Kconfig arch_numa: switch over to numa_memblks 2024-09-03 21:15:32 -07:00
Makefile driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
arch_numa.c arch_numa: Restore nid checks before registering a memblock with a node 2024-12-01 22:04:52 +02:00
arch_topology.c Merge branch 'for-next/smt-control' into for-next/core 2025-03-25 19:32:28 +00:00
attribute_container.c driver core: attribute_container: Remove unused functions 2024-09-13 15:41:42 +02:00
auxiliary.c driver core: auxiliary bus: Spelling s/pecific/specific/ 2024-11-04 01:58:10 +01:00
auxiliary_sysfs.c
base.h driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
bus.c drivers/base/bus.c: fix spelling of "subsystem" 2025-02-21 09:20:30 +01:00
cacheinfo.c cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU 2024-12-06 13:07:47 +01:00
class.c drivers: core: remove device_link argument from class_compat_[create|remove]_link 2025-01-10 15:42:20 +01:00
component.c Driver core updates for 6.15-rc1 2025-04-01 11:02:03 -07:00
container.c
core.c pci-v6.15-changes 2025-03-28 19:36:53 -07:00
cpu.c riscv: Add ghostwrite vulnerability 2025-01-18 12:33:39 -08:00
dd.c Driver core update for 6.12-rc1 2024-09-27 08:48:37 -07:00
devcoredump.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
devres.c Merge drm/drm-next into drm-xe-next 2025-02-28 06:54:14 -08:00
devtmpfs.c vfs-6.15-rc1.async.dir 2025-03-24 10:47:14 -07:00
driver.c driver core: Introduce device_iter_t for device iterating APIs 2025-01-10 15:26:12 +01:00
faux.c driver core: faux: only create the device if probe() succeeds 2025-02-27 18:03:53 -08:00
firmware.c
hypervisor.c
init.c driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
isa.c
map.c
memory.c drivers/base/memory: improve add_boot_memory_block() 2025-03-17 22:07:01 -07:00
module.c Revert "driver core: Fix uevent_show() vs driver detach race" 2024-10-29 01:23:43 +01:00
node.c acpi: numa: Add support to enumerate and store extended linear address mode 2025-02-26 13:45:22 -07:00
physical_location.c driver core: location: Use str_yes_no() helper function 2025-02-21 09:20:30 +01:00
physical_location.h
pinctrl.c
platform-msi.c genirq/msi: Remove platform MSI leftovers 2024-07-18 20:31:21 +02:00
platform.c iommu: Get DT/ACPI parsing into the proper probe path 2025-03-11 14:05:43 +01:00
property.c property: Add functions to iterate named child 2025-04-22 19:09:52 +01:00
soc.c
swnode.c device property: Split property reading bool and presence test ops 2025-01-13 17:47:29 -06:00
syscore.c
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-07 17:58:08 +01:00
trace.c
trace.h devres: Fix page faults when tracing devres from unloaded modules 2024-10-14 08:21:09 +02:00
transport_class.c