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_link.c | |
parent | e3c963c498871e0d4b2eceb32e2b989493838ccc (diff) | |
download | lwn-99ece713773bfa17fdb4ee2a1fb3b7bee82e4b1a.tar.gz lwn-99ece713773bfa17fdb4ee2a1fb3b7bee82e4b1a.zip |
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_link.c')
-rw-r--r-- | drivers/acpi/pci_link.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index cb7b900d9466..d54fb8e54671 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -606,12 +606,10 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, int *polarity, char **name) { - int result; - struct acpi_device *device; + struct acpi_device *device = acpi_fetch_acpi_dev(handle); struct acpi_pci_link *link; - result = acpi_bus_get_device(handle, &device); - if (result) { + if (!device) { acpi_handle_err(handle, "Invalid link device\n"); return -1; } @@ -658,12 +656,10 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, */ int acpi_pci_link_free_irq(acpi_handle handle) { - struct acpi_device *device; + struct acpi_device *device = acpi_fetch_acpi_dev(handle); struct acpi_pci_link *link; - acpi_status result; - result = acpi_bus_get_device(handle, &device); - if (result) { + if (!device) { acpi_handle_err(handle, "Invalid link device\n"); return -1; } |