From: Jonathan Woithe Date: Tue, 22 Dec 2009 22:49:42 +0000 (+1030) Subject: fujitu-laptop: fix tests of acpi_evaluate_integer() return value X-Git-Tag: v2.6.33-rc2~3^2^2~11 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=3b1c37cab3765b87efbd4ed40301ceaf72b9f5c2;p=pandora-kernel.git fujitu-laptop: fix tests of acpi_evaluate_integer() return value Fix tests on return value from acpi_evaluate_integer(). Based on a patch by Roel Kluin and incorporating suggestions from Len Brown . Signed-off-by: Roel Kluin Signed-off-by: Jonathan Woithe Signed-off-by: Len Brown --- diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index bcd4ba8be7db..3c2d0384b43b 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -376,8 +376,8 @@ 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)) + return 0; fujitsu->brightness_level = state & 0x0fffffff; @@ -398,8 +398,8 @@ 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)) + return -1; fujitsu->max_brightness = state;