Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: bus: Add iterator for dependent devices

Add a helper macro to iterate over ACPI devices that are flagged
as consumers of an initial supplier ACPI device.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Daniel Scally and committed by
Rafael J. Wysocki
62c8bc0d cca8a7ef

+11
+11
include/acpi/acpi_bus.h
··· 745 745 struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier, 746 746 struct acpi_device *start); 747 747 748 + /** 749 + * for_each_acpi_consumer_dev - iterate over the consumer ACPI devices for a 750 + * given supplier 751 + * @supplier: Pointer to the supplier's ACPI device 752 + * @consumer: Pointer to &struct acpi_device to hold the consumer, initially NULL 753 + */ 754 + #define for_each_acpi_consumer_dev(supplier, consumer) \ 755 + for (consumer = acpi_dev_get_next_consumer_dev(supplier, NULL); \ 756 + consumer; \ 757 + consumer = acpi_dev_get_next_consumer_dev(supplier, consumer)) 758 + 748 759 struct acpi_device * 749 760 acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); 750 761 struct acpi_device *