From patchwork Sun Apr 12 11:26:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 17819 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3CBQZqW007056 for ; Sun, 12 Apr 2009 11:26:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759343AbZDLL0i (ORCPT ); Sun, 12 Apr 2009 07:26:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760137AbZDLL0i (ORCPT ); Sun, 12 Apr 2009 07:26:38 -0400 Received: from static-220-247-10-204.b-man.svips.gol.ne.jp ([220.247.10.204]:41443 "EHLO smtp.kamineko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760059AbZDLL0f (ORCPT ); Sun, 12 Apr 2009 07:26:35 -0400 Received: by smtp.kamineko.org (Postfix, from userid 8) id A0B8724003; Sun, 12 Apr 2009 20:26:33 +0900 (JST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on enma.kamineko.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.2.5 Received: from caligola.kamineko.org (unknown [192.168.1.34]) by smtp.kamineko.org (Postfix) with ESMTP id D1D4C2400E; Sun, 12 Apr 2009 20:26:31 +0900 (JST) Received: by caligola.kamineko.org (Postfix, from userid 1000) id 9E9D215FF3; Sun, 12 Apr 2009 20:26:31 +0900 (JST) From: Mattia Dongili To: Len Brown Cc: linux-acpi@vger.kernel.org, Mattia Dongili Subject: [PATCH 5/6] sony-laptop: fix bogus error message display on resume Date: Sun, 12 Apr 2009 20:26:30 +0900 Message-Id: <1239535591-15514-6-git-send-email-malattia@linux.it> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <1239535591-15514-5-git-send-email-malattia@linux.it> References: <1239535591-15514-1-git-send-email-malattia@linux.it> <1239535591-15514-2-git-send-email-malattia@linux.it> <1239535591-15514-3-git-send-email-malattia@linux.it> <1239535591-15514-4-git-send-email-malattia@linux.it> <1239535591-15514-5-git-send-email-malattia@linux.it> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org sony_backlight_update_status returns 0 on success -1 on failure (i.e.: the return value from acpi_callsetfunc. The return value in the resume path was broken and thus always displaying a bogus warning about not being able to restore the brightness level. Signed-off-by: Mattia Dongili --- drivers/platform/x86/sony-laptop.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index ddbd86b..419873a 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1041,7 +1041,7 @@ static int sony_nc_resume(struct acpi_device *device) /* set the last requested brightness level */ if (sony_backlight_device && - !sony_backlight_update_status(sony_backlight_device)) + sony_backlight_update_status(sony_backlight_device) < 0) printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n"); return 0;