Skip to content

Commit

Permalink
ACPI: glue: Use acpi_device_adr() in acpi_find_child_device()
Browse files Browse the repository at this point in the history
Instead of evaluating _ADR in acpi_find_child_device(), use the
observation that it has already been evaluated and the value returned
by it has been stored in the pnp.type.bus_address field of the ACPI
device object at hand.

Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
rafaeljw committed Oct 28, 2021
1 parent 87440d7 commit 61a3c78
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,10 @@ struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
return NULL;

list_for_each_entry(adev, &parent->children, node) {
unsigned long long addr;
acpi_status status;
acpi_bus_address addr = acpi_device_adr(adev);
int score;

status = acpi_evaluate_integer(adev->handle, METHOD_NAME__ADR,
NULL, &addr);
if (ACPI_FAILURE(status) || addr != address)
if (!adev->pnp.type.bus_address || addr != address)
continue;

if (!ret) {
Expand Down

0 comments on commit 61a3c78

Please sign in to comment.