Skip to content

Commit cf6ba07

Browse files
committed
ACPI: bus: Introduce acpi_dev_for_each_child()
Introduce a wrapper around device_for_each_child() to iterate over the children of a given ACPI device object. This function will be used in subsequent change sets. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent ce522ba commit cf6ba07

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/acpi/bus.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,12 @@ int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data)
10701070
}
10711071
EXPORT_SYMBOL_GPL(acpi_bus_for_each_dev);
10721072

1073+
int acpi_dev_for_each_child(struct acpi_device *adev,
1074+
int (*fn)(struct device *, void *), void *data)
1075+
{
1076+
return device_for_each_child(&adev->dev, data, fn);
1077+
}
1078+
10731079
/* --------------------------------------------------------------------------
10741080
Initialization/Cleanup
10751081
-------------------------------------------------------------------------- */

include/acpi/acpi_bus.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ void acpi_initialize_hp_context(struct acpi_device *adev,
481481
extern struct bus_type acpi_bus_type;
482482

483483
int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
484+
int acpi_dev_for_each_child(struct acpi_device *adev,
485+
int (*fn)(struct device *, void *), void *data);
484486

485487
/*
486488
* Events

0 commit comments

Comments
 (0)