]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitabc0cd38514d65d14e0ad1bba5dc8dd60f0d8519
treeb2a4460b85fa7c2bff9c7235a9d007a9c3ade9ce
parent8fde0bd02af33882e7c5c1efdc169adea3557a9b
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