From patchwork Wed Apr 5 06:49:06 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: 9663047 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 3FA7560353 for ; Wed, 5 Apr 2017 06:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C63284FE for ; Wed, 5 Apr 2017 06:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2594728507; Wed, 5 Apr 2017 06:50:05 +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=unavailable 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 D31DB284FE for ; Wed, 5 Apr 2017 06:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400AbdDEGtX (ORCPT ); Wed, 5 Apr 2017 02:49:23 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:36860 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754344AbdDEGtV (ORCPT ); Wed, 5 Apr 2017 02:49:21 -0400 Received: by mail-lf0-f65.google.com with SMTP id n78so353699lfi.3 for ; Tue, 04 Apr 2017 23:49:20 -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=LImAEUB+hPw1p2mwoSWAVJJidjCdrG+inopWgE+JB3Q=; b=DCCHcIeK+/i2oZVTK1LSx/XAQBKdirXaRlViJ/xduvimtZ/8VxD3JFni06mATmuJ1q 8D++gxiUwhaCgNfO4Rx/nGTkZA6mt8dooGBBZsCW2NhV5kMIpGuo1yQubw9kr8YnlEU6 2ELgZn1GpBPQJGGSGm06pxKa+NBnlge8PbnEU= 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=LImAEUB+hPw1p2mwoSWAVJJidjCdrG+inopWgE+JB3Q=; b=RqwfQAW0eOBmPzGXS/VYSS0FCqgDEsTYG3PNNm4jh9rzU9mSDBnUydY2uTIkpYveg2 L3FcBCwPkZvYbJdoFqEsivw5qRKUIl6eAK7kTClV6GMSNx9pxYThWPqWhqDB9IRGNfAO 5dOtwMJVbBUp06HasJsjclA/GAvf51k6Wnwhp94kerG08aYwXm7suvutb5AJtraFE3Um z2LAytjw7Jd9GdJ1u+89Ps6Q8dR61Du1Q8CUWCx+oyhjYSF7GPXVBvsBab9oxRby6Gtb jUxZ5DPbkal36ufaZXTa63l8//huaWJZnYAU7djuMTU3C3gQTZ9IA4k6N2tFhSdWWcSv fHpA== X-Gm-Message-State: AFeK/H2hVTGubJ9HEIECvD2Gf+YvHh527MMS3noTWTqJXsY1QPywAp8xKQcCx5W7mrIiXA== X-Received: by 10.25.216.220 with SMTP id r89mr8538399lfi.153.1491374959484; Tue, 04 Apr 2017 23:49:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 23:49:19 -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 07/11] platform/x86: fujitsu-laptop: make disable_brightness_adjust a boolean Date: Wed, 5 Apr 2017 08:49:06 +0200 Message-Id: <20170405064910.3162-8-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 Due to the way the disable_brightness_adjust module parameter is currently handled in acpi_fujitsu_bl_add(), it can only be set to either 0 or 1, which effectively makes it a boolean. Emphasize that by changing module parameter type to bool. Do not announce parameter value in a debug message as it can be dynamically changed via sysfs and its current value can also be read from there. Clean up module parameter description. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index cd2da9a02592..a3e9efd1ac88 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -147,7 +147,7 @@ struct fujitsu_bl { static struct fujitsu_bl *fujitsu_bl; static int use_alt_lcd_levels = -1; -static int disable_brightness_adjust = -1; +static bool disable_brightness_adjust; /* Device used to access hotkeys and other features on the laptop */ struct fujitsu_laptop { @@ -612,11 +612,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) pr_err("_INI Method failed\n"); } - /* do config (detect defaults) */ - disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0; - vdbg_printk(FUJLAPTOP_DBG_INFO, "config: [adjust disable: %d]\n", - disable_brightness_adjust); - if (get_max_brightness() <= 0) fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS; get_lcd_level(); @@ -655,7 +650,7 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event) if (oldb == newb) return; - if (disable_brightness_adjust != 1) + if (!disable_brightness_adjust) set_lcd_level(newb); sparse_keymap_report_event(input, oldb < newb, 1, true); @@ -1150,8 +1145,8 @@ module_exit(fujitsu_cleanup); module_param(use_alt_lcd_levels, int, 0644); MODULE_PARM_DESC(use_alt_lcd_levels, "Interface used for setting LCD brightness level (-1 = auto, 0 = force SBLL, 1 = force SBL2)"); -module_param(disable_brightness_adjust, uint, 0644); -MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment ."); +module_param(disable_brightness_adjust, bool, 0644); +MODULE_PARM_DESC(disable_brightness_adjust, "Disable LCD brightness adjustment"); #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG module_param_named(debug, dbg_level, uint, 0644); MODULE_PARM_DESC(debug, "Sets debug level bit-mask");