Skip to contentSkip to conversation

ACPI: bus: Eliminate acpi_bus_get_device()

PATCH In review Rafael J. Wysocki 3 participants 3 messages Apr 5, 2022 – Apr 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: bus: Eliminate acpi_bus_get_device()

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/acpi/scan.c     |   13 -------------
 drivers/spi/spi.c       |    3 ++-
 include/acpi/acpi_bus.h |    1 -
 3 files changed, 2 insertions(+), 15 deletions(-)
drivers/spi/spi.c +2 -1
Index: linux-pm/drivers/spi/spi.c
===================================================================
@@ -2406,7 +2406,8 @@ static int acpi_spi_add_resource(struct
 			} else {
 				struct acpi_device *adev;
 
-				if (acpi_bus_get_device(parent_handle, &adev))
+				adev = acpi_fetch_acpi_dev(parent_handle);
+				if (!adev)
 					return -ENODEV;
 
 				ctlr = acpi_spi_find_controller_by_adev(adev);
include/acpi/acpi_bus.h +0 -1
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
@@ -511,7 +511,6 @@ extern int unregister_acpi_notifier(stru
  * External Functions
  */
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle);
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta);
drivers/acpi/scan.c +0 -13
Index: linux-pm/drivers/acpi/scan.c
===================================================================
@@ -588,19 +588,6 @@ static struct acpi_device *handle_to_dev
 	return adev;
 }
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
-{
-	if (!device)
-		return -EINVAL;
-
-	*device = handle_to_device(handle, NULL);
-	if (!*device)
-		return -ENODEV;
-
-	return 0;
-}
-EXPORT_SYMBOL(acpi_bus_get_device);
-
 /**
  * acpi_fetch_acpi_dev - Retrieve ACPI device object.
  * @handle: ACPI handle associated with the requested ACPI device object.
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Or I can take this via the SPI tree?

#2 lore raw
Quoted 10 lines · Mark Brown
Quoted 6 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Thanks!

Quoted 1 line

Or I can take this via the SPI tree?

I'm going to push this for -rc2 so acpi_bus_get_device() is not there in case somebody has a plan to use it again. :-)