]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: glue: Introduce acpi_dev_has_children()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 13 Jun 2022 18:06:18 +0000 (20:06 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Jun 2022 18:28:48 +0000 (20:28 +0200)
commit90c1aa073b1751fedefccd6f4f4cb62c8115357f
treee97bf7514f005eb107d1faa1f0f22e4a14de6059
parent6f7dfe789a4cb90cd9c5316b645e1d0c4b3d2af7
ACPI: glue: Introduce acpi_dev_has_children()

Define acpi_dev_has_children() as a wrapper around
acpi_dev_for_each_child() and use it to check if the given ACPI
device has any children instead of checking the children list
head in struct acpi_device.

This will help to eliminate the children list head from struct
acpi_device as it is redundant and it is used in questionable ways
in some places (in particular, locking is needed for walking the
list pointed to it safely, but it is often missing).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/acpi/glue.c