]> git.baikalelectronics.ru Git - kernel.git/commitdiff
platform/x86: samsung-laptop: Drop duplicate check for led_classdev_unregister()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 May 2020 16:37:23 +0000 (19:37 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 May 2020 17:14:24 +0000 (20:14 +0300)
led_classdev_unregister() already has the very same check, so,
drop a duplicate in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/samsung-laptop.c

index 23e40aa2176e861ce98db35e7ec4ca6ae1d5c3e9..d5cec6e35bb83618e74168bfbffd31de2f5bf2a8 100644 (file)
@@ -1138,8 +1138,7 @@ static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
 
 static void samsung_leds_exit(struct samsung_laptop *samsung)
 {
-       if (!IS_ERR_OR_NULL(samsung->kbd_led.dev))
-               led_classdev_unregister(&samsung->kbd_led);
+       led_classdev_unregister(&samsung->kbd_led);
        if (samsung->led_workqueue)
                destroy_workqueue(samsung->led_workqueue);
 }