ACPI: utils: Introduce helper for _DEP list lookup
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 14 Dec 2023 11:07:55 +0000 (12:07 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Dec 2023 17:25:00 +0000 (18:25 +0100)
commitd70d141bb15f328528f94557ddf754abeb027365
tree8a21e48ff11d3a91b45aaec96656d27a928d968a
parent4c660ffef34b7d645ae3144369bc50257f295212
ACPI: utils: Introduce helper for _DEP list lookup

The ACPI LPSS driver and the Surface platform driver code use almost the
same code pattern for checking if one ACPI device is present in the list
returned by _DEP for another ACPI device.

To reduce the resulting code duplication, introduce a helper for that
called acpi_device_dep() and invoke it from both places.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/acpi/acpi_lpss.c
drivers/acpi/utils.c
drivers/platform/surface/surface_acpi_notify.c
include/acpi/acpi_bus.h