aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-05-16 18:45:45 -0400
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-05-16 18:45:45 -0400
commit263f4a30e4f1dc5385650738c1dcf3728036ecc4 (patch)
tree0de27cb495f08d066970d4943613590b32e8fb50 /drivers
parent437e470c4ca818c97426afa3a67fbd7e34cffe00 (diff)
thinkpad-acpi: acpi_evalf fixes
Use acpi_format_exception() in acpi_evalf() instead of logging numeric errors. Also, when ACPICA returns an error, we should not be touching the return object, as it is invalid. In debug mode, acpi_evalf() callers would printk the returned crap (but fortunately, not use it). Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 877a7802e83..da3a70b280f 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -605,9 +605,10 @@ static int acpi_evalf(acpi_handle handle,
605 605
606 switch (res_type) { 606 switch (res_type) {
607 case 'd': /* int */ 607 case 'd': /* int */
608 if (res) 608 success = (status == AE_OK &&
609 out_obj.type == ACPI_TYPE_INTEGER);
610 if (success && res)
609 *(int *)res = out_obj.integer.value; 611 *(int *)res = out_obj.integer.value;
610 success = status == AE_OK && out_obj.type == ACPI_TYPE_INTEGER;
611 break; 612 break;
612 case 'v': /* void */ 613 case 'v': /* void */
613 success = status == AE_OK; 614 success = status == AE_OK;
@@ -620,8 +621,8 @@ static int acpi_evalf(acpi_handle handle,
620 } 621 }
621 622
622 if (!success && !quiet) 623 if (!success && !quiet)
623 printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %d\n", 624 printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n",
624 method, fmt0, status); 625 method, fmt0, acpi_format_exception(status));
625 626
626 return success; 627 return success;
627} 628}