wmi: convert acpi_evaluate_object() to acpi_execute_simple_method()
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> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
619400dae9
commit
8122ab66b1
|
@ -252,8 +252,6 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
|
||||||
{
|
{
|
||||||
struct guid_block *block = NULL;
|
struct guid_block *block = NULL;
|
||||||
char method[5];
|
char method[5];
|
||||||
struct acpi_object_list input;
|
|
||||||
union acpi_object params[1];
|
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
|
|
||||||
|
@ -263,13 +261,9 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
|
||||||
if (!block)
|
if (!block)
|
||||||
return AE_NOT_EXIST;
|
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);
|
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)
|
if (status != AE_OK && status != AE_NOT_FOUND)
|
||||||
return status;
|
return status;
|
||||||
|
@ -355,8 +349,8 @@ struct acpi_buffer *out)
|
||||||
struct wmi_block *wblock = NULL;
|
struct wmi_block *wblock = NULL;
|
||||||
acpi_handle handle, wc_handle;
|
acpi_handle handle, wc_handle;
|
||||||
acpi_status status, wc_status = AE_ERROR;
|
acpi_status status, wc_status = AE_ERROR;
|
||||||
struct acpi_object_list input, wc_input;
|
struct acpi_object_list input;
|
||||||
union acpi_object wc_params[1], wq_params[1];
|
union acpi_object wq_params[1];
|
||||||
char method[5];
|
char method[5];
|
||||||
char wc_method[5] = "WC";
|
char wc_method[5] = "WC";
|
||||||
|
|
||||||
|
@ -386,11 +380,6 @@ struct acpi_buffer *out)
|
||||||
* enable collection.
|
* enable collection.
|
||||||
*/
|
*/
|
||||||
if (block->flags & ACPI_WMI_EXPENSIVE) {
|
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);
|
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);
|
wc_status = acpi_get_handle(handle, wc_method, &wc_handle);
|
||||||
if (ACPI_SUCCESS(wc_status))
|
if (ACPI_SUCCESS(wc_status))
|
||||||
wc_status = acpi_evaluate_object(handle, wc_method,
|
wc_status = acpi_execute_simple_method(handle,
|
||||||
&wc_input, NULL);
|
wc_method, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(method, "WQ");
|
strcpy(method, "WQ");
|
||||||
|
@ -414,9 +403,7 @@ struct acpi_buffer *out)
|
||||||
* the WQxx method failed - we should disable collection anyway.
|
* the WQxx method failed - we should disable collection anyway.
|
||||||
*/
|
*/
|
||||||
if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
|
if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
|
||||||
wc_params[0].integer.value = 0;
|
status = acpi_execute_simple_method(handle, wc_method, 0);
|
||||||
status = acpi_evaluate_object(handle,
|
|
||||||
wc_method, &wc_input, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
Loading…
Reference in New Issue