From 8db1b16c790d251fd0f5c2a4b91bb36f4f7b0a21 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Wed, 2 Sep 2020 10:21:04 +0200 Subject: [PATCH] Fix uw kbd bl rgb sysfs removal --- src/uniwill_keyboard.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index c4bb112..1597a34 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -750,10 +750,12 @@ static int uniwill_keyboard_remove(struct platform_device *dev) { int i; + if (uniwill_kbd_bl_type_rgb_single_color) { + sysfs_remove_group(&dev->dev.kobj, &uw_kbd_bl_color_attr_group); + } + // Restore previous backlight enable state if (uniwill_kbd_bl_enable_state_on_start != 0xff) { - 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); }