diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-05-07 19:37:23 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-05-07 20:14:17 +0300 |
commit | 410a772419bf7d5641ecb7c75a91d9768be2dbdb (patch) | |
tree | 94025a852162973108a64b073d97c09d92f9e062 /drivers/platform/x86/lg-laptop.c | |
parent | e257dd340f2723be1a28d41e1a66d589ec3d914c (diff) | |
download | linux-410a772419bf7d5641ecb7c75a91d9768be2dbdb.tar.bz2 |
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>
Diffstat (limited to 'drivers/platform/x86/lg-laptop.c')
-rw-r--r-- | drivers/platform/x86/lg-laptop.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c index c0bb1f864dfe..dd900a76d8de 100644 --- a/drivers/platform/x86/lg-laptop.c +++ b/drivers/platform/x86/lg-laptop.c @@ -67,9 +67,7 @@ static u32 inited; #define INIT_INPUT_WMI_0 0x01 #define INIT_INPUT_WMI_2 0x02 #define INIT_INPUT_ACPI 0x04 -#define INIT_TPAD_LED 0x08 -#define INIT_KBD_LED 0x10 -#define INIT_SPARSE_KEYMAP 0x80 +#define INIT_SPARSE_KEYMAP 0x80 static const struct key_entry wmi_keymap[] = { {KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */ @@ -626,11 +624,9 @@ static int acpi_add(struct acpi_device *device) if (ret) goto out_platform_device; - if (!led_classdev_register(&pf_device->dev, &kbd_backlight)) - inited |= INIT_KBD_LED; - - if (!led_classdev_register(&pf_device->dev, &tpad_led)) - inited |= INIT_TPAD_LED; + /* LEDs are optional */ + led_classdev_register(&pf_device->dev, &kbd_backlight); + led_classdev_register(&pf_device->dev, &tpad_led); wmi_input_setup(); @@ -646,11 +642,9 @@ out_platform_registered: static int acpi_remove(struct acpi_device *device) { sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group); - if (inited & INIT_KBD_LED) - led_classdev_unregister(&kbd_backlight); - if (inited & INIT_TPAD_LED) - led_classdev_unregister(&tpad_led); + led_classdev_unregister(&tpad_led); + led_classdev_unregister(&kbd_backlight); wmi_input_destroy(); platform_device_unregister(pf_device); |