uw: fix module cleanup for non single rgb kbd bl

This commit is contained in:
Christoffer Sandberg 2020-10-27 09:18:36 +01:00
parent fbd1cd8e8a
commit 8c0a618f6b

View file

@ -640,7 +640,8 @@ static int uniwill_keyboard_remove(struct platform_device *dev)
{ {
// Restore previous backlight enable state // Restore previous backlight enable state
if (uniwill_kbd_bl_enable_state_on_start != 0xff) { 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); uniwill_write_kbd_bl_enable(uniwill_kbd_bl_enable_state_on_start);
} }