diff options
author | Carlos Corbacho <carlos@strangeworlds.co.uk> | 2008-02-24 08:34:34 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-03-11 17:59:05 -0400 |
commit | a527f2d7fe58ce95bfec998f3dc6f658c777a2f2 (patch) | |
tree | c55c8f3366ba0f955619a48e0f0a88ff070247bd /drivers/acpi | |
parent | 9b963c40306ba6967650dce99f4e823f1da49a60 (diff) |
ACPI: WMI: Clean up handling of spec violating data blocks
Acer violate the ACPI-WMI spec by declaring some of their data blocks as
expensive, but with no corresponding WCxx method. There is already some
workaround code in to handle the initial WCxx call (we just ignore a
failure here); but we need to properly check if the second, "clean up",
WCxx call is actually needed or not, rather than fail simply because it
isn't there.
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/wmi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c index efacc9f8bfe3..c33b1c6e93b1 100644 --- a/drivers/acpi/wmi.c +++ b/drivers/acpi/wmi.c | |||
@@ -293,7 +293,7 @@ struct acpi_buffer *out) | |||
293 | { | 293 | { |
294 | struct guid_block *block = NULL; | 294 | struct guid_block *block = NULL; |
295 | struct wmi_block *wblock = NULL; | 295 | struct wmi_block *wblock = NULL; |
296 | acpi_handle handle; | 296 | acpi_handle handle, wc_handle; |
297 | acpi_status status, wc_status = AE_ERROR; | 297 | acpi_status status, wc_status = AE_ERROR; |
298 | struct acpi_object_list input, wc_input; | 298 | struct acpi_object_list input, wc_input; |
299 | union acpi_object wc_params[1], wq_params[1]; | 299 | union acpi_object wc_params[1], wq_params[1]; |
@@ -338,8 +338,10 @@ struct acpi_buffer *out) | |||
338 | * expensive, but have no corresponding WCxx method. So we | 338 | * expensive, but have no corresponding WCxx method. So we |
339 | * should not fail if this happens. | 339 | * should not fail if this happens. |
340 | */ | 340 | */ |
341 | wc_status = acpi_evaluate_object(handle, wc_method, | 341 | wc_status = acpi_get_handle(handle, wc_method, &wc_handle); |
342 | &wc_input, NULL); | 342 | if (ACPI_SUCCESS(wc_status)) |
343 | wc_status = acpi_evaluate_object(handle, wc_method, | ||
344 | &wc_input, NULL); | ||
343 | } | 345 | } |
344 | 346 | ||
345 | strcpy(method, "WQ"); | 347 | strcpy(method, "WQ"); |
@@ -351,7 +353,7 @@ struct acpi_buffer *out) | |||
351 | * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if | 353 | * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if |
352 | * the WQxx method failed - we should disable collection anyway. | 354 | * the WQxx method failed - we should disable collection anyway. |
353 | */ | 355 | */ |
354 | if ((block->flags & ACPI_WMI_EXPENSIVE) && wc_status) { | 356 | if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) { |
355 | wc_params[0].integer.value = 0; | 357 | wc_params[0].integer.value = 0; |
356 | status = acpi_evaluate_object(handle, | 358 | status = acpi_evaluate_object(handle, |
357 | wc_method, &wc_input, NULL); | 359 | wc_method, &wc_input, NULL); |