Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: bus: Eliminate acpi_bus_get_device()

Replace the last instance of acpi_bus_get_device(), added recently
by commit 87e59b36e5e2 ("spi: Support selection of the index of the
ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and
finally drop acpi_bus_get_device() that has no more users.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>

+2 -15
-13
drivers/acpi/scan.c
··· 588 588 return adev; 589 589 } 590 590 591 - int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) 592 - { 593 - if (!device) 594 - return -EINVAL; 595 - 596 - *device = handle_to_device(handle, NULL); 597 - if (!*device) 598 - return -ENODEV; 599 - 600 - return 0; 601 - } 602 - EXPORT_SYMBOL(acpi_bus_get_device); 603 - 604 591 /** 605 592 * acpi_fetch_acpi_dev - Retrieve ACPI device object. 606 593 * @handle: ACPI handle associated with the requested ACPI device object.
+2 -1
drivers/spi/spi.c
··· 2406 2406 } else { 2407 2407 struct acpi_device *adev; 2408 2408 2409 - if (acpi_bus_get_device(parent_handle, &adev)) 2409 + adev = acpi_fetch_acpi_dev(parent_handle); 2410 + if (!adev) 2410 2411 return -ENODEV; 2411 2412 2412 2413 ctlr = acpi_spi_find_controller_by_adev(adev);
-1
include/acpi/acpi_bus.h
··· 509 509 * External Functions 510 510 */ 511 511 512 - int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); 513 512 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle); 514 513 acpi_status acpi_bus_get_status_handle(acpi_handle handle, 515 514 unsigned long long *sta);