Skip to content

Commit

Permalink
platform/x86: asus-wmi: Drop duplicate check for led_classdev_unregis…
Browse files Browse the repository at this point in the history
…ter()

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>
  • Loading branch information
Andy Shevchenko committed May 7, 2020
1 parent 55523ab commit 2225dba
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2225dba

Please sign in to comment.