thunderbolt: ACPI: Replace tb_acpi_find_port() with acpi_find_child_by_adr()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Jun 2022 18:32:26 +0000 (20:32 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Jun 2022 18:32:26 +0000 (20:32 +0200)
commita73a204b44586c07876f18e329be3fcb713af29b
treed016b48aa47268e98f1959a202e84864ce7f9e7e
parent2f6fe93fede802acfe010752db461ccd34745745
thunderbolt: ACPI: Replace tb_acpi_find_port() with acpi_find_child_by_adr()

Use acpi_find_child_by_adr() to find the child matching a given bus
address instead of tb_acpi_find_port() that walks the list of children
of an ACPI device directly for this purpose and drop the latter.

Apart from simplifying the code, 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>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
drivers/thunderbolt/acpi.c