From patchwork Wed Apr 5 06:49:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9663043 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB18F60353 for ; Wed, 5 Apr 2017 06:49:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC1F1284FE for ; Wed, 5 Apr 2017 06:49:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0A6728507; Wed, 5 Apr 2017 06:49:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4981C28505 for ; Wed, 5 Apr 2017 06:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396AbdDEGtb (ORCPT ); Wed, 5 Apr 2017 02:49:31 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35840 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754439AbdDEGt1 (ORCPT ); Wed, 5 Apr 2017 02:49:27 -0400 Received: by mail-lf0-f67.google.com with SMTP id n78so353726lfi.3 for ; Tue, 04 Apr 2017 23:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gyq3+8EtC1cY3J45/FY0rVgr3U/e1QQ6sD4RGP+rsSY=; b=ifcf6goA8nVUoZxd5T6ABKhxNtBjbFiDK//ivzOZdKqMJWTSyr/iUTP6x2anhbW2qm r7cJbplfrhAz4zmidueLpV5PWX+sqxqF2MdEKz6qORQ3bN+H4IwE1+u0SQ/NyhU15O1i l/ZiuqLVymtmjmzwG9ZrrSYJ8ZNstkGvAIoc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gyq3+8EtC1cY3J45/FY0rVgr3U/e1QQ6sD4RGP+rsSY=; b=oNdtgTz9t41XUofs6sDF9VwZhUlpOHdGcKupvPpGZTpemOxuxYpyZFMqB0uewPHhRt Xhjr1j9eSxHRO3lFIzgm6BniYdjolN2SaOywgLkkLl/+TtXLvAInizQQCR1i+Vfa3mkx 2wDqIjInFRiVJgioETSJITIceMip2C9BcL526SFHujxPqKjKhmpC0bu/02Vt1RE4yn/O qpCcznO4Y9O052WOnpAXcUmCwEQ76NIzi2K1/w/R2VRRxARmB/3zLuaXHokhDLZIwU0O XK623UIybdfhyTP/Fh2fo/x0kssyaIaAEMNJ8SCX2JAKour/xrXD/HQDHHCFjFJFi6Oe yiRQ== X-Gm-Message-State: AFeK/H0KRS+9hLUWJBEYAOD+wcMJqUol20n9IkEtzRn4k68aQbOfr6SFYUTRrGKCcQKPPQ== X-Received: by 10.25.99.153 with SMTP id v25mr8631193lfi.170.1491374961116; Tue, 04 Apr 2017 23:49:21 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id o91sm3619921lfg.1.2017.04.04.23.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 23:49:20 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 09/11] platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in bl_update_status() Date: Wed, 5 Apr 2017 08:49:08 +0200 Message-Id: <20170405064910.3162-10-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170405064910.3162-1-kernel@kempniu.pl> References: <20170405064910.3162-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Any set_lcd_level() call can fail for one of two reasons: either requested brightness is outside the allowed range or the ACPI method used for setting brightness level is not available. For bl_update_status(), the first case is handled by backlight core, which means bl_update_status() will not even be called if requested brightness is outside the allowed range. The second case will be logged anyway by set_lcd_level() itself, so there is no point in generating another message in bl_update_status(). Remove the superfluous debug message along with a local variable that is now redundant. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 0cd58c96938c..a797e7890773 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -443,18 +443,12 @@ static int bl_get_brightness(struct backlight_device *b) static int bl_update_status(struct backlight_device *b) { - int ret; if (b->props.power == FB_BLANK_POWERDOWN) call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3); else call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0); - ret = set_lcd_level(b->props.brightness); - if (ret != 0) - vdbg_printk(FUJLAPTOP_DBG_ERROR, - "Unable to adjust LCD brightness, error code %i\n", - ret); - return ret; + return set_lcd_level(b->props.brightness); } static const struct backlight_ops fujitsu_bl_ops = {