Skip to contentSkip to conversation

ACPI: Move acpi_bus_get_device() from bus.c to scan.c

PATCH In review Rafael J. Wysocki 2 participants 3 messages Jul 27, 2013 – Sep 10, 2013

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

PATCH 1/1 ACPI: Move acpi_bus_get_device() from bus.c to scan.c

From: Rafael J. Wysocki <[email protected]>
Subject: ACPI: Move acpi_bus_get_device() from bus.c to scan.c

Move acpi_bus_get_device() from bus.c to scan.c which allows acpi_bus_data_handler() to become static and clean up the latter.

---
 drivers/acpi/bus.c      |   21 ---------------------
 drivers/acpi/scan.c     |   30 ++++++++++++++++++++++--------
 include/acpi/acpi_bus.h |    1 -
 3 files changed, 22 insertions(+), 30 deletions(-)
drivers/acpi/bus.c +0 -21
Index: linux-pm/drivers/acpi/bus.c
===================================================================
@@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_tab
                                 Device Management
    -------------------------------------------------------------------------- */
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
-{
-	acpi_status status;
-
-	if (!device)
-		return -EINVAL;
-
-	/* TBD: Support fixed-feature devices */
-
-	status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
-	if (ACPI_FAILURE(status) || !*device) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
-				  handle));
-		return -ENODEV;
-	}
-
-	return 0;
-}
-
-EXPORT_SYMBOL(acpi_bus_get_device);
-
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta)
 {
drivers/acpi/scan.c +22 -8
Index: linux-pm/drivers/acpi/scan.c
===================================================================
@@ -970,6 +970,28 @@ struct bus_type acpi_bus_type = {
 	.uevent		= acpi_device_uevent,
 };
 
+static void acpi_bus_data_handler(acpi_handle handle, void *context)
+{
+	/* Intentionally empty. */
+}
+
+int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
+{
+	acpi_status status;
+
+	if (!device)
+		return -EINVAL;
+
+	status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
+	if (ACPI_FAILURE(status) || !*device) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
+				  handle));
+		return -ENODEV;
+	}
+	return 0;
+}
+EXPORT_SYMBOL_GPL(acpi_bus_get_device);
+
 int acpi_device_add(struct acpi_device *device,
 		    void (*release)(struct device *))
 {
@@ -1181,14 +1203,6 @@ acpi_bus_get_ejd(acpi_handle handle, acp
 }
 EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
 
-void acpi_bus_data_handler(acpi_handle handle, void *context)
-{
-
-	/* TBD */
-
-	return;
-}
-
 static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
 					struct acpi_device_wakeup *wakeup)
 {
include/acpi/acpi_bus.h +0 -1
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
@@ -371,7 +371,6 @@ extern int unregister_acpi_notifier(stru
  */
 
 int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
-void acpi_bus_data_handler(acpi_handle handle, void *context);
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta);
 int acpi_bus_get_status(struct acpi_device *device);
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Quoted 14 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]> Subject: ACPI: Move acpi_bus_get_device() from bus.c to scan.c

Move acpi_bus_get_device() from bus.c to scan.c which allows acpi_bus_data_handler() to become static and clean up the latter.

21 --------------------- drivers/acpi/scan.c | 30 ++++++++++++++++++++++--------
include/acpi/acpi_bus.h | 1 - 3 files changed, 22 insertions(+), 30 deletions(-)

Index: linux-pm/drivers/acpi/bus.c =================================================================== --- linux-pm.orig/drivers/acpi/bus.c +++ linux-pm/drivers/acpi/bus.c @@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_tab Device Management

[cut]

Quoted 6 lines

- -EXPORT_SYMBOL(acpi_bus_get_device); - acpi_status acpi_bus_get_status_handle(acpi_handle handle, unsigned long long *sta) { Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -970,6 +970,28 @@ struct
bus_type acpi_bus_type = { .uevent = acpi_device_uevent, };

[cut]

Quoted 1 line

+} +EXPORT_SYMBOL_GPL(acpi_bus_get_device); +

Was it intentional to change the EXPORT_SYMBOL to EXPORT_SYMBOL_GPL here? While I understand that it is completely unsupported anyway, this change does break at least the latest version of the proprietary nvidia graphics driver.

- --
Jonathan Callen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJSLpeMAAoJELHSF2kinlg4EGEP/2lav3ETWSAs7BqeDGCuacZ4 CqkWJlMJDvYawW443KdBEb8aM27tx+gqNp+ktHkWXuXG97X79yAVTRMggOCuaqkb AgYJkDXRY+64UWtn2GeCM4vSsBOB86UoSspdZXHzF6JBDXrdd2ZXkpb1q7u1xBdi SZIz3PxZmBLMVcxu+Bh67e1hRXbxKxfKlF1Zl7MC/9NDnxkZmrOklqY2VamG864a OkFU12bvgdGCwOnq1gHzDjt2PIjL7RNxY4wPWvnyJ1DDOi2tb5tC7hw8VoUTqUPx h81QmAY2T/XFWTpfNnmJgrQYw+AE8B1TNz+ciKWRi0VCAAjYdomPCYfjxnfYBvN2 a1RRAUMG7DFOZxzBNE9Yv371zEAKLAt2Kbt5PynSqTiivRu7XJOpz5326Q1P9Csy HZ369Gu7oC2ErAEv3mO82do5pM6/10DpwFPhY5eGq8l7rdStk8cRdUW1Ivc/d0sx CDt0ZDVV+bvtduwnMTRiXWIgR2w/iUuNcwU5RfU/2NsJLyXeUoMdR0OHLa1sDSVk bK3Jc6AAPQG8aV83Je50eFeYUQgYN9DZ2eRR+KtzBFaI4TXXzq3H+1E5QBBqbfc8 6PZuVC+CwMYmmhsozvkyyKIdYVJL0KiWOgaZueNq6Z2Fqiupr4BrMpKvS1rkix4y Pn0TU7V4arGbXGzJN1VZ
=SHrw
-----END PGP SIGNATURE-----

#2 lore raw
Quoted 22 lines · Jonathan Callen
Quoted 14 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]> Subject: ACPI: Move acpi_bus_get_device() from bus.c to scan.c

Move acpi_bus_get_device() from bus.c to scan.c which allows acpi_bus_data_handler() to become static and clean up the latter.

21 --------------------- drivers/acpi/scan.c | 30 ++++++++++++++++++++++--------
include/acpi/acpi_bus.h | 1 - 3 files changed, 22 insertions(+), 30 deletions(-)

Index: linux-pm/drivers/acpi/bus.c =================================================================== --- linux-pm.orig/drivers/acpi/bus.c +++ linux-pm/drivers/acpi/bus.c @@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_tab Device Management

[cut]

Quoted 6 lines

- -EXPORT_SYMBOL(acpi_bus_get_device); - acpi_status acpi_bus_get_status_handle(acpi_handle handle, unsigned long long *sta) { Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -970,6 +970,28 @@ struct
bus_type acpi_bus_type = { .uevent = acpi_device_uevent, };

Quoted 4 lines

[cut]

Quoted 1 line

+} +EXPORT_SYMBOL_GPL(acpi_bus_get_device); +

Was it intentional to change the EXPORT_SYMBOL to EXPORT_SYMBOL_GPL here?

Yes, it was.

Quoted 2 lines

While I understand that it is completely unsupported anyway, this change does break at least the latest version of the proprietary nvidia graphics driver.

This commit has been in linux-next for over a month and no one has spoken a word about this problem. I'm not going to revert that change now, sorry.

Thanks,
Rafael