From patchwork Fri Apr 7 13:07: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: 9669489 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 15B99602B3 for ; Fri, 7 Apr 2017 13:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08B39285EB for ; Fri, 7 Apr 2017 13:08:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1CA5285F2; Fri, 7 Apr 2017 13:08:13 +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 928CC285EB for ; Fri, 7 Apr 2017 13:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756242AbdDGNIM (ORCPT ); Fri, 7 Apr 2017 09:08:12 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35487 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755546AbdDGNHT (ORCPT ); Fri, 7 Apr 2017 09:07:19 -0400 Received: by mail-lf0-f66.google.com with SMTP id v2so6096208lfi.2 for ; Fri, 07 Apr 2017 06:07:18 -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=vA9h9wUuInxQRIev8VlTYoHQT+aV5FRJNaHiVJCVQnY=; b=CwpGsw6r5l3Pbyvl8IVx59srp1EkXwRcz1WeFuajBXbK0bQdK8toTpML0JqsEkbVf3 /I9jw/dz7gm3pA1aEWsm4/lCh3Cw/0dqqngTt6OTNKcPZoDUqnCx1cI0Qz5oMUo5M4Ot atHMu+XA8LRpaIKpzPglEH4JRe7NDtpFRVjMs= 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=vA9h9wUuInxQRIev8VlTYoHQT+aV5FRJNaHiVJCVQnY=; b=KjmgE6UTrFAEIgml/2zYfs9dxBfN86yYIjpy/vEhK/u1lBkVrNS2uRHg1OSr2moik/ dJvJRJgXUc2qbbvmH611GkjH+j8QuU2toIqecMBtFI5iKCo5btAvqDTDtde4ZDn4kzjW anyaw1o2pnYNDjnkMVy4+TK2zw/O4q/F3okP1mCMzTNjIdjLckxhaNdKnEUhUfxCUIAw xoV5Q93lbh1C1UBkqtUCjEEQXvKo9UzuGZuXrOdjuT+gOmS1yterduHg7c+p19yKfQE5 v0aR8w89LBVxoPgSaXb7iz7RmIJCNOgHDr2lBdiyPAx6L3okTpMXHeoZmOTnsrWO35fK 8oAg== X-Gm-Message-State: AFeK/H2j9ALGzRjon60rHxAAAuvRClxcB8DIPPytlr9eTTOLipJhJrTdcQe8OyCgHu/Eqg== X-Received: by 10.25.216.103 with SMTP id p100mr13019837lfg.16.1491570437133; Fri, 07 Apr 2017 06:07:17 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id 17sm961440ljp.58.2017.04.07.06.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Apr 2017 06:07:16 -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 1/6] platform/x86: fujitsu-laptop: select LEDS_CLASS Date: Fri, 7 Apr 2017 15:07:08 +0200 Message-Id: <20170407130713.8417-2-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170407130713.8417-1-kernel@kempniu.pl> References: <20170407130713.8417-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 Follow common subsystem practice of selecting LEDS_CLASS instead of riddling module code with #ifdefs. Signed-off-by: Michał Kępień --- drivers/platform/x86/Kconfig | 2 +- drivers/platform/x86/fujitsu-laptop.c | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 5602bdfcad65..d18acb1105a5 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -182,8 +182,8 @@ config FUJITSU_LAPTOP depends on INPUT depends on BACKLIGHT_CLASS_DEVICE depends on ACPI_VIDEO || ACPI_VIDEO = n - depends on LEDS_CLASS || LEDS_CLASS=n select INPUT_SPARSEKMAP + select LEDS_CLASS ---help--- This is a driver for laptops built by Fujitsu: diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 9fd5b98aeef8..555de246b994 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -59,11 +59,9 @@ #include #include #include +#include #include #include -#if IS_ENABLED(CONFIG_LEDS_CLASS) -#include -#endif #include #define FUJITSU_DRIVER_VERSION "0.6.0" @@ -94,7 +92,6 @@ #define FLAG_LID 0x100 #define FLAG_DOCK 0x200 -#if IS_ENABLED(CONFIG_LEDS_CLASS) /* FUNC interface - LED control */ #define FUNC_LED_OFF 0x1 #define FUNC_LED_ON 0x30001 @@ -104,7 +101,6 @@ #define RADIO_LED_ON 0x20 #define ECO_LED 0x10000 #define ECO_LED_ON 0x80000 -#endif /* Hotkey details */ #define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */ @@ -165,7 +161,6 @@ struct fujitsu_laptop { static struct fujitsu_laptop *fujitsu_laptop; -#if IS_ENABLED(CONFIG_LEDS_CLASS) static enum led_brightness logolamp_get(struct led_classdev *cdev); static int logolamp_set(struct led_classdev *cdev, enum led_brightness brightness); @@ -206,7 +201,6 @@ static struct led_classdev eco_led = { .brightness_get = eco_led_get, .brightness_set_blocking = eco_led_set }; -#endif #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG static u32 dbg_level = 0x03; @@ -253,7 +247,6 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) return value; } -#if IS_ENABLED(CONFIG_LEDS_CLASS) /* LED class callbacks */ static int logolamp_set(struct led_classdev *cdev, @@ -349,7 +342,6 @@ static enum led_brightness eco_led_get(struct led_classdev *cdev) return brightness; } -#endif /* Hardware access for LCD brightness control */ @@ -845,7 +837,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) if (error) goto err_free_fifo; -#if IS_ENABLED(CONFIG_LEDS_CLASS) if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) { result = led_classdev_register(&fujitsu_laptop->pf_device->dev, &logolamp_led); @@ -902,7 +893,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) result); } } -#endif return result; @@ -916,7 +906,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device) { struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device); -#if IS_ENABLED(CONFIG_LEDS_CLASS) if (fujitsu_laptop->logolamp_registered) led_classdev_unregister(&logolamp_led); @@ -928,7 +917,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device) if (fujitsu_laptop->eco_led_registered) led_classdev_unregister(&eco_led); -#endif fujitsu_laptop_platform_remove();