diff mbox

[05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer()

Message ID 4B0D10C7.6080603@gmail.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Roel Kluin Nov. 25, 2009, 11:11 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index bcd4ba8..714c472 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -376,8 +376,10 @@  static int get_lcd_level(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
-	if (status < 0)
-		return status;
+	if (ACPI_FAILURE(status)) {
+		pr_warning("%s failed, acpi error: %u\n", __func__, status);
+		return -EINVAL;
+	}
 
 	fujitsu->brightness_level = state & 0x0fffffff;
 
@@ -398,8 +400,10 @@  static int get_max_brightness(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
-	if (status < 0)
-		return status;
+	if (ACPI_FAILURE(status)) {
+		pr_warning("%s failed, acpi error: %u\n", __func__, status);
+		return -EINVAL;
+	}
 
 	fujitsu->max_brightness = state;