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)
commitf5122be80daad8e53e6876add5ccbf9db7ca809c
treee97bf7514f005eb107d1faa1f0f22e4a14de6059
parentd21b57003041a5a5d28933fd2dfd1c5183fb23af
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