From patchwork Thu Mar 30 10:35:07 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: 9653683 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 B5CD360113 for ; Thu, 30 Mar 2017 10:36:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FA282857D for ; Thu, 30 Mar 2017 10:36:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9453F28581; Thu, 30 Mar 2017 10:36:02 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 3130D2857D for ; Thu, 30 Mar 2017 10:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932958AbdC3KgB (ORCPT ); Thu, 30 Mar 2017 06:36:01 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35505 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933689AbdC3Kf2 (ORCPT ); Thu, 30 Mar 2017 06:35:28 -0400 Received: by mail-lf0-f66.google.com with SMTP id v2so4167091lfi.2 for ; Thu, 30 Mar 2017 03:35:22 -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=LjbwMTpzTcRGg/qtZh7YfWU3Wh27fFspyfetpqxTAH4=; b=etoP3AUyutpnDvQo86c2tTT4tj7z5JY1Cyjjrz4dm2KSDREEZgkLiKLYeWngai3SA3 g9k3Nzqo13pXhfVwA3gBhADUccEb4xPBUII2hiFyTlwqnHAjjEJF9TddfKSsbYpAsETJ gH2PASZVTh5f+ZUHJ6GNqXL69cOC2cKi9GD7U= 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=LjbwMTpzTcRGg/qtZh7YfWU3Wh27fFspyfetpqxTAH4=; b=Xa7ArMrmT786/qcgB0Ou6V2d+iltuMPUzURkpcj8iWpPwJlaXUbAXyWm+njVUFl0bp vELvhJUIEGrcRBiqwOAAe8I1ts9Wh/MG5sV7JbXAntjAusZ+2ByAVne9/3ORuk7CEmML LbIvBNNwUkv6qxGE7KEHBgXUYSVU0gTSVcoAEHw1nEK3k3DInQFheMPg5v/+ur2BpowO 4ZiZK2MRG1lfHTfqV4sJY6h1Y6s/ybrUmiLRLk1Z+k4A8kV3VXG1dl1OBY0ruRYbL1EL 9kNhcgl2qqy6MkWvqvaE63tizlxGxuerRs74tbIuS5S5JxHrYCHd+BCHAIdYjwoeD3IW APSg== X-Gm-Message-State: AFeK/H1FxjqVuVf89NiuUNzyBu2GR3iFfWvOuxB/vnd7R108/8nHk2gO1PrOxDgBT3+olw== X-Received: by 10.25.80.1 with SMTP id e1mr1603264lfb.82.1490870121339; Thu, 30 Mar 2017 03:35:21 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id x1sm296975lfb.54.2017.03.30.03.35.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 03:35: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 09/11] platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in bl_update_status() Date: Thu, 30 Mar 2017 12:35:07 +0200 Message-Id: <20170330103509.32509-10-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170330103509.32509-1-kernel@kempniu.pl> References: <20170330103509.32509-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 ed9c37e0591d..78a39b143200 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -442,18 +442,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 = {