diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-12-03 17:37:10 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-12-17 18:45:51 +0100 |
commit | 99ece713773bfa17fdb4ee2a1fb3b7bee82e4b1a (patch) | |
tree | dc5fc7a0bdbd65678c60cc8f1125191587e4e2e8 /drivers/acpi/pci_root.c | |
parent | e3c963c498871e0d4b2eceb32e2b989493838ccc (diff) |
ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device()
Modify the ACPI code to use acpi_fetch_acpi_dev() instead of
acpi_bus_get_device() where applicable.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index ab2f7dfb0c44..41a8fef06534 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -67,11 +67,10 @@ static struct acpi_scan_handler pci_root_handler = { */ int acpi_is_root_bridge(acpi_handle handle) { + struct acpi_device *device = acpi_fetch_acpi_dev(handle); int ret; - struct acpi_device *device; - ret = acpi_bus_get_device(handle, &device); - if (ret) + if (!device) return 0; ret = acpi_match_device_ids(device, root_device_ids); @@ -215,11 +214,10 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle) { + struct acpi_device *device = acpi_fetch_acpi_dev(handle); struct acpi_pci_root *root; - struct acpi_device *device; - if (acpi_bus_get_device(handle, &device) || - acpi_match_device_ids(device, root_device_ids)) + if (!device || acpi_match_device_ids(device, root_device_ids)) return NULL; root = acpi_driver_data(device); |