[PATCH 2/2] ACPI: Remove tpacpi_acpi_handle_locate_callback and make use of the global implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
CC: Matthew Garrett <mjg@xxxxxxxxxx>
CC: Len Brown <lenb@xxxxxxxxxx>
CC: linux-acpi@xxxxxxxxxxxxxxx
CC: seth.forshee@xxxxxxxxxxxxx
CC: Azael Avalos <coproscefalo@xxxxxxxxx>
CC: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
---
 drivers/platform/x86/thinkpad_acpi.c |   48 ++++-----------------------------
 1 files changed, 6 insertions(+), 42 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 7b82868..c95a3af 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -698,43 +698,6 @@ static void __init drv_acpi_handle_init(const char *name,
 	*handle = NULL;
 }
 
-static acpi_status __init tpacpi_acpi_handle_locate_callback(acpi_handle handle,
-			u32 level, void *context, void **return_value)
-{
-	*(acpi_handle *)return_value = handle;
-
-	return AE_CTRL_TERMINATE;
-}
-
-static void __init tpacpi_acpi_handle_locate(const char *name,
-		const char *hid,
-		acpi_handle *handle)
-{
-	acpi_status status;
-	acpi_handle device_found;
-
-	BUG_ON(!name || !hid || !handle);
-	vdbg_printk(TPACPI_DBG_INIT,
-			"trying to locate ACPI handle for %s, using HID %s\n",
-			name, hid);
-
-	memset(&device_found, 0, sizeof(device_found));
-	status = acpi_get_devices(hid, tpacpi_acpi_handle_locate_callback,
-				  (void *)name, &device_found);
-
-	*handle = NULL;
-
-	if (ACPI_SUCCESS(status)) {
-		*handle = device_found;
-		dbg_printk(TPACPI_DBG_INIT,
-			   "Found ACPI handle for %s\n", name);
-	} else {
-		vdbg_printk(TPACPI_DBG_INIT,
-			    "Could not locate an ACPI handle for %s: %s\n",
-			    name, acpi_format_exception(status));
-	}
-}
-
 static void dispatch_acpi_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct ibm_struct *ibm = data;
@@ -6142,9 +6105,10 @@ static unsigned int __init tpacpi_check_std_acpi_brightness_support(void)
 {
 	acpi_handle video_device;
 	int bcl_levels = 0;
+	int ret;
 
-	tpacpi_acpi_handle_locate("video", ACPI_VIDEO_HID, &video_device);
-	if (video_device)
+	ret = acpi_get_device_handle(ACPI_VIDEO_HID, &video_device);
+	if (!ret)
 		bcl_levels = tpacpi_query_bcl_levels(video_device);
 
 	tp_features.bright_acpimode = (bcl_levels > 0);
@@ -8677,7 +8641,7 @@ static int __must_check __init get_thinkpad_model_data(
 
 static int __init probe_for_thinkpad(void)
 {
-	int is_thinkpad;
+	int is_thinkpad, ret;
 
 	if (acpi_disabled)
 		return -ENODEV;
@@ -8695,8 +8659,8 @@ static int __init probe_for_thinkpad(void)
 		      tpacpi_is_fw_known();
 
 	/* The EC handler is required */
-	tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle);
-	if (!ec_handle) {
+	ret = acpi_get_device_handle(TPACPI_ACPI_EC_HID, &ec_handle);
+	if (ret) {
 		if (is_thinkpad)
 			pr_err("Not yet supported ThinkPad detected!\n");
 		return -ENODEV;
-- 
1.7.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux