From: Yurii Pavlovskyi Date: Tue, 14 May 2019 19:07:46 +0000 (+0200) Subject: platform/x86: asus-wmi: Do not disable keyboard backlight on unloading X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3e58167ac3703c9b15a8600ab559d239f3d4dd97;p=openwrt%2Fstaging%2Fblogic.git platform/x86: asus-wmi: Do not disable keyboard backlight on unloading 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 Signed-off-by: Andy Shevchenko --- diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 5712bc56fa10..508e6ad47793 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); }