From: Zhang Rui <rui.zhang@intel.com>
To: rjw@sisk.pl
Cc: linux-pm@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>,
Matthew Garrett <matthew.garrett@nebula.com>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH 09/27] wmi: convert acpi_evaluate_object() to acpi_execute_simple_method()
Date: Tue, 3 Sep 2013 08:31:57 +0800 [thread overview]
Message-ID: <1378168335-22556-10-git-send-email-rui.zhang@intel.com> (raw)
In-Reply-To: <1378168335-22556-1-git-send-email-rui.zhang@intel.com>
acpi_execute_simple_method() is a new ACPI API introduced to invoke
an ACPI control method that has single integer parameter and no return value.
Convert acpi_evaluate_object() to acpi_execute_simple_method()
in drivers/platform/x86/wmi.c
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: platform-driver-x86@vger.kernel.org
---
drivers/platform/x86/wmi.c | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index b13344c..cb4fe80 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -252,8 +252,6 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
{
struct guid_block *block = NULL;
char method[5];
- struct acpi_object_list input;
- union acpi_object params[1];
acpi_status status;
acpi_handle handle;
@@ -263,13 +261,9 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
if (!block)
return AE_NOT_EXIST;
- input.count = 1;
- input.pointer = params;
- params[0].type = ACPI_TYPE_INTEGER;
- params[0].integer.value = enable;
snprintf(method, 5, "WE%02X", block->notify_id);
- status = acpi_evaluate_object(handle, method, &input, NULL);
+ status = acpi_execute_simple_method(handle, method, enable);
if (status != AE_OK && status != AE_NOT_FOUND)
return status;
@@ -355,8 +349,8 @@ struct acpi_buffer *out)
struct wmi_block *wblock = NULL;
acpi_handle handle, wc_handle;
acpi_status status, wc_status = AE_ERROR;
- struct acpi_object_list input, wc_input;
- union acpi_object wc_params[1], wq_params[1];
+ struct acpi_object_list input;
+ union acpi_object wq_params[1];
char method[5];
char wc_method[5] = "WC";
@@ -386,11 +380,6 @@ struct acpi_buffer *out)
* enable collection.
*/
if (block->flags & ACPI_WMI_EXPENSIVE) {
- wc_input.count = 1;
- wc_input.pointer = wc_params;
- wc_params[0].type = ACPI_TYPE_INTEGER;
- wc_params[0].integer.value = 1;
-
strncat(wc_method, block->object_id, 2);
/*
@@ -400,8 +389,8 @@ struct acpi_buffer *out)
*/
wc_status = acpi_get_handle(handle, wc_method, &wc_handle);
if (ACPI_SUCCESS(wc_status))
- wc_status = acpi_evaluate_object(handle, wc_method,
- &wc_input, NULL);
+ wc_status = acpi_execute_simple_method(handle,
+ wc_method, 1);
}
strcpy(method, "WQ");
@@ -414,9 +403,7 @@ struct acpi_buffer *out)
* the WQxx method failed - we should disable collection anyway.
*/
if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
- wc_params[0].integer.value = 0;
- status = acpi_evaluate_object(handle,
- wc_method, &wc_input, NULL);
+ status = acpi_execute_simple_method(handle, wc_method, 0);
}
return status;
--
1.8.1.2
next prev parent reply other threads:[~2013-09-03 0:31 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 0:31 [PATCH 00/27] ACPI AML helper conversion Zhang Rui
2013-09-03 0:31 ` [PATCH 01/27] olpc_xo15_sci: convert acpi_evaluate_object() to acpi_execute_simple_method() Zhang Rui
2013-09-03 0:31 ` [PATCH 02/27] gpiolib-acpi: " Zhang Rui
2013-09-03 7:17 ` Mika Westerberg
2013-09-03 7:42 ` Mathias Nyman
2013-09-17 12:55 ` Linus Walleij
2013-09-03 0:31 ` [PATCH 03/27] eeepc-laptop: " Zhang Rui
2013-09-03 0:31 ` [PATCH 04/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:11 ` Jonathan Woithe
2013-09-03 0:31 ` [PATCH 05/27] intel-rst: " Zhang Rui
2013-09-03 0:31 ` [PATCH 06/27] intel-smartconnect: " Zhang Rui
2013-09-03 0:31 ` [PATCH 07/27] topstar-laptop: " Zhang Rui
2013-09-03 0:31 ` [PATCH 08/27] toshiba_acpi: " Zhang Rui
2013-09-03 0:31 ` Zhang Rui [this message]
2013-09-03 0:31 ` [PATCH 10/27] pcc_freq: convert acpi_get_handle() to acpi_has_method() Zhang Rui
2013-09-03 0:31 ` [PATCH 11/27] i915: intel_acpi: " Zhang Rui
2013-09-09 8:57 ` Daniel Vetter
2013-09-03 0:32 ` [PATCH 12/27] nouveau_acpi: " Zhang Rui
2013-09-03 0:32 ` [PATCH 13/27] acpi_pcihp: " Zhang Rui
2013-09-03 0:32 ` [PATCH 14/27] pci-acpi: " Zhang Rui
2013-09-03 0:32 ` [PATCH 15/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:11 ` Jonathan Woithe
2013-09-03 0:32 ` [PATCH 16/27] intel_menlow: " Zhang Rui
2013-09-03 0:32 ` [PATCH 17/27] sony-laptop: " Zhang Rui
2013-09-03 0:32 ` [PATCH 18/27] toshiba_acpi: " Zhang Rui
2013-09-03 0:32 ` [PATCH 19/27] wmi: " Zhang Rui
2013-09-03 0:32 ` [PATCH 20/27] pnpacpi: " Zhang Rui
2013-09-03 0:32 ` [PATCH 21/27] acpi_processor: convert acpi_evaluate_object() to acpi_evaluate_integer() Zhang Rui
2013-09-03 0:32 ` [PATCH 22/27] ACPI: dock: " Zhang Rui
2013-09-03 0:32 ` [PATCH 23/27] i2c-hid: " Zhang Rui
2013-09-04 10:14 ` Jiri Kosina
2013-09-06 8:17 ` Benjamin Tissoires
2013-09-03 0:32 ` [PATCH 24/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:12 ` Jonathan Woithe
2013-09-03 0:32 ` [PATCH 25/27] intel-rst: " Zhang Rui
2013-09-03 0:32 ` [PATCH 26/27] intel-smartconnect: " Zhang Rui
2013-09-03 0:32 ` [PATCH 27/27] toshiba_acpi: " Zhang Rui
2013-09-03 11:24 ` [PATCH 00/27] ACPI AML helper conversion Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378168335-22556-10-git-send-email-rui.zhang@intel.com \
--to=rui.zhang@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=matthew.garrett@nebula.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).