diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-01-27 00:40:13 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-02-05 00:10:44 +0100 |
commit | 9a607a54a16314ca4f9ec1843e7c01131d851f33 (patch) | |
tree | fe5244d23588c3a29caa925e64b2ed01fe114ae3 /drivers/pci/hotplug/acpiphp_glue.c | |
parent | Linux 5.17-rc1 (diff) | |
download | linux-9a607a54a16314ca4f9ec1843e7c01131d851f33.tar.xz linux-9a607a54a16314ca4f9ec1843e7c01131d851f33.zip |
PCI/ACPI: Replace acpi_bus_get_device() with acpi_fetch_acpi_dev()
Replace acpi_bus_get_device() that is going to be dropped with
acpi_fetch_acpi_dev().
No intentional functional impact.
Link: https://lore.kernel.org/r/11930209.O9o76ZdvQC@kreacher
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 12f4b351be67..6efa3d8db9a5 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -226,9 +226,9 @@ static void acpiphp_post_dock_fixup(struct acpi_device *adev) static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, void **rv) { + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); struct acpiphp_bridge *bridge = data; struct acpiphp_context *context; - struct acpi_device *adev; struct acpiphp_slot *slot; struct acpiphp_func *newfunc; acpi_status status = AE_OK; @@ -238,6 +238,9 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, struct pci_dev *pdev = bridge->pci_dev; u32 val; + if (!adev) + return AE_OK; + status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) @@ -245,8 +248,6 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, "can't evaluate _ADR (%#x)\n", status); return AE_OK; } - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; device = (adr >> 16) & 0xffff; function = adr & 0xffff; |