aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2013-09-02 20:31:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:37:54 -0400
commit8122ab66b129678bf871aef7559640323eb465bb (patch)
tree5cf28a0383b18c2ccec52a34a1133117cb7e14ed /drivers/platform
parent619400dae9f2ee46ffa0a15a4a8a34a306b2aa24 (diff)
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/wmi.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 601ea9512242..3bb55060bd05 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)
252{ 252{
253 struct guid_block *block = NULL; 253 struct guid_block *block = NULL;
254 char method[5]; 254 char method[5];
255 struct acpi_object_list input;
256 union acpi_object params[1];
257 acpi_status status; 255 acpi_status status;
258 acpi_handle handle; 256 acpi_handle handle;
259 257
@@ -263,13 +261,9 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
263 if (!block) 261 if (!block)
264 return AE_NOT_EXIST; 262 return AE_NOT_EXIST;
265 263
266 input.count = 1;
267 input.pointer = params;
268 params[0].type = ACPI_TYPE_INTEGER;
269 params[0].integer.value = enable;
270 264
271 snprintf(method, 5, "WE%02X", block->notify_id); 265 snprintf(method, 5, "WE%02X", block->notify_id);
272 status = acpi_evaluate_object(handle, method, &input, NULL); 266 status = acpi_execute_simple_method(handle, method, enable);
273 267
274 if (status != AE_OK && status != AE_NOT_FOUND) 268 if (status != AE_OK && status != AE_NOT_FOUND)
275 return status; 269 return status;
@@ -355,8 +349,8 @@ struct acpi_buffer *out)
355 struct wmi_block *wblock = NULL; 349 struct wmi_block *wblock = NULL;
356 acpi_handle handle, wc_handle; 350 acpi_handle handle, wc_handle;
357 acpi_status status, wc_status = AE_ERROR; 351 acpi_status status, wc_status = AE_ERROR;
358 struct acpi_object_list input, wc_input; 352 struct acpi_object_list input;
359 union acpi_object wc_params[1], wq_params[1]; 353 union acpi_object wq_params[1];
360 char method[5]; 354 char method[5];
361 char wc_method[5] = "WC"; 355 char wc_method[5] = "WC";
362 356
@@ -386,11 +380,6 @@ struct acpi_buffer *out)
386 * enable collection. 380 * enable collection.
387 */ 381 */
388 if (block->flags & ACPI_WMI_EXPENSIVE) { 382 if (block->flags & ACPI_WMI_EXPENSIVE) {
389 wc_input.count = 1;
390 wc_input.pointer = wc_params;
391 wc_params[0].type = ACPI_TYPE_INTEGER;
392 wc_params[0].integer.value = 1;
393
394 strncat(wc_method, block->object_id, 2); 383 strncat(wc_method, block->object_id, 2);
395 384
396 /* 385 /*
@@ -400,8 +389,8 @@ struct acpi_buffer *out)
400 */ 389 */
401 wc_status = acpi_get_handle(handle, wc_method, &wc_handle); 390 wc_status = acpi_get_handle(handle, wc_method, &wc_handle);
402 if (ACPI_SUCCESS(wc_status)) 391 if (ACPI_SUCCESS(wc_status))
403 wc_status = acpi_evaluate_object(handle, wc_method, 392 wc_status = acpi_execute_simple_method(handle,
404 &wc_input, NULL); 393 wc_method, 1);
405 } 394 }
406 395
407 strcpy(method, "WQ"); 396 strcpy(method, "WQ");
@@ -414,9 +403,7 @@ struct acpi_buffer *out)
414 * the WQxx method failed - we should disable collection anyway. 403 * the WQxx method failed - we should disable collection anyway.
415 */ 404 */
416 if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) { 405 if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
417 wc_params[0].integer.value = 0; 406 status = acpi_execute_simple_method(handle, wc_method, 0);
418 status = acpi_evaluate_object(handle,
419 wc_method, &wc_input, NULL);
420 } 407 }
421 408
422 return status; 409 return status;