]> git.baikalelectronics.ru Git - kernel.git/commitdiff
platform/x86: asus-wmi: 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 16:38:48 +0000 (19:38 +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/asus-wmi.c

index bb7c529d7d16135347e472385693aeffb104d5be..e705ae66c083ee1a811be780b2cab98c3d09e010 100644 (file)
@@ -675,14 +675,11 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
 
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
-       if (!IS_ERR_OR_NULL(asus->kbd_led.dev))
-               led_classdev_unregister(&asus->kbd_led);
-       if (!IS_ERR_OR_NULL(asus->tpd_led.dev))
-               led_classdev_unregister(&asus->tpd_led);
-       if (!IS_ERR_OR_NULL(asus->wlan_led.dev))
-               led_classdev_unregister(&asus->wlan_led);
-       if (!IS_ERR_OR_NULL(asus->lightbar_led.dev))
-               led_classdev_unregister(&asus->lightbar_led);
+       led_classdev_unregister(&asus->kbd_led);
+       led_classdev_unregister(&asus->tpd_led);
+       led_classdev_unregister(&asus->wlan_led);
+       led_classdev_unregister(&asus->lightbar_led);
+
        if (asus->led_workqueue)
                destroy_workqueue(asus->led_workqueue);
 }