LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Yurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Corentin Chary <corentin.chary@gmail.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Daniel Drake <drake@endlessm.com>, Chris Chiu <chiu@endlessm.com>,
	acpi4asus-user@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 13/13] platform/x86: asus-wmi: Do not disable keyboard backlight on unloading
Date: Tue, 14 May 2019 21:07:46 +0200	[thread overview]
Message-ID: <8b24b62b-4271-1010-ca5f-2974088b1857@gmail.com> (raw)
In-Reply-To: <c8cdb347-e206-76b2-0d43-546ef660ffb7@gmail.com>

The keyboard backlight is automatically disabled when the module is
unloaded as it is exposed as a ledclass device. Change this behavior to
ignore setting brightness when the device is in unloading state.

Signed-off-by: Yurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
---
 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 feb8d72fc3c5..0c330d6a5871 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -471,6 +471,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);
 }
 
-- 
2.17.1


  parent reply	other threads:[~2019-05-14 19:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 18:47 [PATCH v4 00/13] Support of ASUS TUF Gaming series laptops Yurii Pavlovskyi
2019-05-14 18:50 ` [PATCH v4 01/13] platform/x86: asus-wmi: Fix hwmon device cleanup Yurii Pavlovskyi
2019-05-24 19:54   ` Daniel Drake
2019-05-14 18:51 ` [PATCH v4 02/13] platform/x86: asus-wmi: Fix preserving keyboard backlight intensity on load Yurii Pavlovskyi
2019-05-24 19:57   ` Daniel Drake
2019-05-14 18:54 ` [PATCH v4 03/13] platform/x86: asus-wmi: Increase input buffer size of WMI methods Yurii Pavlovskyi
2019-05-24 20:01   ` Daniel Drake
2019-05-14 18:59 ` [PATCH v4 04/13] platform/x86: wmi: Add function to get _UID of WMI device Yurii Pavlovskyi
2019-05-24 21:10   ` Daniel Drake
2019-05-14 19:00 ` [PATCH v4 05/13] platform/x86: asus-wmi: Improve DSTS WMI method ID detection Yurii Pavlovskyi
2019-05-14 19:01 ` [PATCH v4 06/13] platform/x86: asus-wmi: Refactor WMI event handling Yurii Pavlovskyi
2019-05-14 19:02 ` [PATCH v4 07/13] platform/x86: asus-wmi: Support WMI event queue Yurii Pavlovskyi
2019-05-14 19:02 ` [PATCH v4 08/13] platform/x86: asus-nb-wmi: Add microphone mute key code Yurii Pavlovskyi
2019-05-14 19:03 ` [PATCH v4 09/13] platform/x86: asus-wmi: Refactor error handling Yurii Pavlovskyi
2019-05-14 19:04 ` [PATCH v4 10/13] platform/x86: asus-wmi: Organize code into sections Yurii Pavlovskyi
2019-05-14 19:05 ` [PATCH v4 11/13] platform/x86: asus-wmi: Enhance detection of thermal data Yurii Pavlovskyi
2019-05-14 19:07 ` [PATCH v4 12/13] platform/x86: asus-wmi: Switch fan boost mode Yurii Pavlovskyi
2019-05-14 19:07 ` Yurii Pavlovskyi [this message]
2019-06-29 13:13 ` [PATCH v4 00/13] Support of ASUS TUF Gaming series laptops Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b24b62b-4271-1010-ca5f-2974088b1857@gmail.com \
    --to=yurii.pavlovskyi@gmail.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=andy@infradead.org \
    --cc=chiu@endlessm.com \
    --cc=corentin.chary@gmail.com \
    --cc=drake@endlessm.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --subject='Re: [PATCH v4 13/13] platform/x86: asus-wmi: Do not disable keyboard backlight on unloading' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).