From 8c0a618f6b69612c1c5707bd152c1aeb9d81d5e7 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Tue, 27 Oct 2020 09:18:36 +0100 Subject: [PATCH] uw: fix module cleanup for non single rgb kbd bl --- src/uniwill_keyboard.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index 4bd65ba..6b5dcdc 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -640,7 +640,8 @@ static int uniwill_keyboard_remove(struct platform_device *dev) { // Restore previous backlight enable state if (uniwill_kbd_bl_enable_state_on_start != 0xff) { - sysfs_remove_group(&dev->dev.kobj, &uw_kbd_bl_color_attr_group); + if (uniwill_kbd_bl_type_rgb_single_color) + sysfs_remove_group(&dev->dev.kobj, &uw_kbd_bl_color_attr_group); uniwill_write_kbd_bl_enable(uniwill_kbd_bl_enable_state_on_start); }