Skip to content

Commit

Permalink
fujitu-laptop: fix tests of acpi_evaluate_integer() return value
Browse files Browse the repository at this point in the history
Fix tests on return value from acpi_evaluate_integer().  Based on a patch by
Roel Kluin <roel.kluin@gmail.com> and incorporating suggestions from Len
Brown <lenb@kernel.org>.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Jonathan Woithe authored and Len Brown committed Dec 23, 2009
1 parent 4a28395 commit 3b1c37c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/platform/x86/fujitsu-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 3b1c37c

Please sign in to comment.