From patchwork Thu Apr 11 05:48:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yurii Pavlovskyi X-Patchwork-Id: 10895121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C24F0139A for ; Thu, 11 Apr 2019 05:48:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A815528AE6 for ; Thu, 11 Apr 2019 05:48:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B1C328BCE; Thu, 11 Apr 2019 05:48:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 8B12228BC5 for ; Thu, 11 Apr 2019 05:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726230AbfDKFsY (ORCPT ); Thu, 11 Apr 2019 01:48:24 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40334 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbfDKFsX (ORCPT ); Thu, 11 Apr 2019 01:48:23 -0400 Received: by mail-wr1-f67.google.com with SMTP id h4so5540407wre.7; Wed, 10 Apr 2019 22:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:cc:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=HEDFtZPjLhuw6ilImkRaRAXhlx/SXG1tE/jQF3qj854=; b=NhhasY+7nb2KxTeHpUsr/miI+LxNjwoykgV6pQuhCDJnCw6GMlhSDYmNix+tS9+IYS n84ocOPzGi4NXyMq6MN6AiZbC73qftZ5IKsvYvCv8XiIWz0IqEXsH2pyHdRuTQqKn2Cg h7hOsFUhKO94tl2GY3SuHq5vukuW1/lb1MARNx8zBS1LeM/9PC+3wW3cq5nZKUhrT5kx ok0bUAhkMljI+WhZqEfO524Lrsd2roEGTFGJaIIrMafnxtwJlI4954bp5r7aviWypNCR 4xCE9kSZu5QIdilh2rn4wwnJAEpqZYGgz5Sb6DqvXdnFkeDWZVe7yirvVzZ6Aswl8zYm 1h5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HEDFtZPjLhuw6ilImkRaRAXhlx/SXG1tE/jQF3qj854=; b=BJ0DIKUgPmihs+lhtDH879a3IpqDO8d7DyWXERa/kVs58rxXkOrcRWMSvmT8ZnDOB0 Ql+92RgdUkHzkYo/B/tKfUtzFHxXMb3jGg1ChWb5t4rIR5utraBrGaKspa95zzUidiYs MTbNUEo4R2TrxGzlsA21GpMTH70MSKbT/QnzFsFUS651Zrz3iKsYkz5I5bRCnhh9X2R/ M0wox9P0Cq1lKINxRaeRuEquRipoXrf147tJLOs8E7iEip1oxUsd0EQ4NZniFYcQDl6m 4VcckEp92jE5kaTl+ynhb+Lg/qqvUPPFoKt4PkNOsHsKeG4aOwfHTaK8NeSrytlQpaT1 ARTw== X-Gm-Message-State: APjAAAVoCkJ/eyo4MJmY0AIobmSHOS+qm6oAycw5+uUWdlf1JzLyUBJ6 maIbYuo3Rf1IEp+DmQS2lc5u1/ycLsI= X-Google-Smtp-Source: APXvYqwUOfnuPo5Rfwmkj51+fKixfMF2dKHajg5sfwku2kR7OzhIrxOe7EIwFzzzkmMnbm/+z0Dtyw== X-Received: by 2002:adf:d848:: with SMTP id k8mr30487884wrl.185.1554961701991; Wed, 10 Apr 2019 22:48:21 -0700 (PDT) Received: from [192.168.20.141] ([194.99.104.18]) by smtp.gmail.com with ESMTPSA id e7sm5079056wme.37.2019.04.10.22.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 22:48:21 -0700 (PDT) Subject: [PATCH v2 11/11] platform/x86: asus-wmi: Do not disable keyboard backlight on unload From: Yurii Pavlovskyi Cc: Corentin Chary , Darren Hart , Andy Shevchenko , Daniel Drake , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <2b130755-87bb-b7a5-939b-4d0ebd69af68@gmail.com> Message-ID: <00efe227-9db9-8709-2de2-d863166c5437@gmail.com> Date: Thu, 11 Apr 2019 07:48:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <2b130755-87bb-b7a5-939b-4d0ebd69af68@gmail.com> Content-Language: en-US To: unlisted-recipients:; (no To-header on input) 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 The keyboard backlight is disabled when module is unloaded as it is exposed as LED device. Change this behavior to ignore setting 0 brightness when the ledclass device is unloading. Signed-off-by: Yurii Pavlovskyi --- drivers/platform/x86/asus-wmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index f0e506feb924..f49992fa87b3 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -475,6 +475,10 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value) static void kbd_led_set(struct led_classdev *led_cdev, enum led_brightness value) { + /* Prevent disabling keyboard backlight on module unregister */ + if (led_cdev->flags & LED_UNREGISTERING) + return; + do_kbd_led_set(led_cdev, value); }