From patchwork Tue Dec 22 22:49:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Woithe X-Patchwork-Id: 69337 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBMMoW0v012701 for ; Tue, 22 Dec 2009 22:50:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751730AbZLVWub (ORCPT ); Tue, 22 Dec 2009 17:50:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752183AbZLVWub (ORCPT ); Tue, 22 Dec 2009 17:50:31 -0500 Received: from adelphi.physics.adelaide.edu.au ([129.127.102.1]:56689 "EHLO adelphi.physics.adelaide.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbZLVWua (ORCPT ); Tue, 22 Dec 2009 17:50:30 -0500 Received: from turbo.physics.adelaide.edu.au (IDENT:0@turbo [129.127.102.108]) by adelphi.physics.adelaide.edu.au (8.13.7/8.13.7/UofA-Physics-1.0) with ESMTP id nBMMngBB026781; Wed, 23 Dec 2009 09:19:42 +1030 Received: from turbo.physics.adelaide.edu.au (IDENT:7157@localhost [127.0.0.1]) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4) with ESMTP id nBMMngrQ002407; Wed, 23 Dec 2009 09:19:42 +1030 Received: (from jwoithe@localhost) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4/Submit) id nBMMngkl002406; Wed, 23 Dec 2009 09:19:42 +1030 From: Jonathan Woithe Message-Id: <200912222249.nBMMngkl002406@turbo.physics.adelaide.edu.au> Subject: [PATCH] fujitus-laptop: fix tests of acpi_evaluate_integer() return value To: linux-acpi@vger.kernel.org, roel.kluin@gmail.com, lenb@kernel.org Date: Wed, 23 Dec 2009 09:19:42 +1030 (CST) Cc: jwoithe@physics.adelaide.edu.au (Jonathan Woithe) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org --- a/drivers/platform/x86/fujitsu-laptop.c 2009-12-23 09:11:23.599497331 +1030 +++ b/drivers/platform/x86/fujitsu-laptop.c 2009-12-23 09:12:12.754405304 +1030 @@ -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;