platform/x86/thinkpad_acpi: Use acpi_dev_for_each_child()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 13 Jun 2022 18:30:19 +0000 (20:30 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 21 Jun 2022 12:34:52 +0000 (14:34 +0200)
commit0b1bd1e356643319809903034ffd2e6b5834271e
treeb2a4460b85fa7c2bff9c7235a9d007a9c3ade9ce
parenta976a2ac7708c63257d42707c8423047136797a0
platform/x86/thinkpad_acpi: Use acpi_dev_for_each_child()

Instead of walking the list of children of an ACPI device directly,
use acpi_dev_for_each_child() to carry out an action for all of
the given ACPI device's children.

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>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/thinkpad_acpi.c