Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: lg-laptop: Drop duplicate check for led_classdev_unregister()

led_classdev_unregister() already has the similar check, so,
drop a duplicate in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

+6 -12
+6 -12
drivers/platform/x86/lg-laptop.c
··· 67 67 #define INIT_INPUT_WMI_0 0x01 68 68 #define INIT_INPUT_WMI_2 0x02 69 69 #define INIT_INPUT_ACPI 0x04 70 - #define INIT_TPAD_LED 0x08 71 - #define INIT_KBD_LED 0x10 72 - #define INIT_SPARSE_KEYMAP 0x80 70 + #define INIT_SPARSE_KEYMAP 0x80 73 71 74 72 static const struct key_entry wmi_keymap[] = { 75 73 {KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */ ··· 624 626 if (ret) 625 627 goto out_platform_device; 626 628 627 - if (!led_classdev_register(&pf_device->dev, &kbd_backlight)) 628 - inited |= INIT_KBD_LED; 629 - 630 - if (!led_classdev_register(&pf_device->dev, &tpad_led)) 631 - inited |= INIT_TPAD_LED; 629 + /* LEDs are optional */ 630 + led_classdev_register(&pf_device->dev, &kbd_backlight); 631 + led_classdev_register(&pf_device->dev, &tpad_led); 632 632 633 633 wmi_input_setup(); 634 634 ··· 642 646 static int acpi_remove(struct acpi_device *device) 643 647 { 644 648 sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group); 645 - if (inited & INIT_KBD_LED) 646 - led_classdev_unregister(&kbd_backlight); 647 649 648 - if (inited & INIT_TPAD_LED) 649 - led_classdev_unregister(&tpad_led); 650 + led_classdev_unregister(&tpad_led); 651 + led_classdev_unregister(&kbd_backlight); 650 652 651 653 wmi_input_destroy(); 652 654 platform_device_unregister(pf_device);