Re: [PATCH 7/8] acpi: avoid using internal acpica structures

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

 



Lin Ming wrote:
On Wed, 2008-11-26 at 16:12 +0800, Alexey Starikovskiy wrote:
At least, this patch should be split in two -- for each file it touches.

OK, will split it into two.

Second, please don't return failure status from this function, as all functions under
the EC scope should be tried, and not only ones before first failure.

How about below patch?

---
 drivers/acpi/ec.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 591b4f6..99bff80 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -754,12 +754,20 @@ static acpi_status
 acpi_ec_register_query_methods(acpi_handle handle, u32 level,
 			       void *context, void **return_value)
 {
-	struct acpi_namespace_node *node = handle;
+	char node_name[5];
+	struct acpi_buffer buffer = { sizeof(node_name), node_name };
 	struct acpi_ec *ec = context;
 	int value = 0;
-	if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
-		acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
+	acpi_status status;
+
+	status = acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
Merge the above two lines?
+
+	if (ACPI_SUCCESS(status)) {
+		if (sscanf(node_name, "_Q%x", &value) == 1) {
single if (ACPI_SUCCESS(status) && sscanf(node_name, "_Q%x", &value) == 1) ?
+			acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
+		}
 	}
+ return AE_OK;
 }
Thanks for review,
Lin Ming
--
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