Commit 75747129 authored by Corentin Chary's avatar Corentin Chary Committed by Corentin Chary

asus-laptop: leds, remove dead code and fix asus_led_exit()/asus_led_init()

These bug where introduced in "asus-laptop: code movement".
Signed-off-by: default avatarCorentin Chary <corentin.chary@gmail.com>
parent a539df5e
...@@ -371,13 +371,7 @@ static int asus_led_set(struct asus_laptop *asus, char *method, ...@@ -371,13 +371,7 @@ static int asus_led_set(struct asus_laptop *asus, char *method,
enum led_brightness value); \ enum led_brightness value); \
static enum led_brightness object##_led_get( \ static enum led_brightness object##_led_get( \
struct led_classdev *led_cdev); \ struct led_classdev *led_cdev); \
static void object##_led_update(struct work_struct *ignored); \ static void object##_led_update(struct work_struct *ignored);
static struct led_classdev object##_led = { \
.name = "asus::" ledname, \
.brightness_set = object##_led_set, \
.brightness_get = object##_led_get, \
.max_brightness = max \
}
ASUS_LED(mled, "mail", 1); ASUS_LED(mled, "mail", 1);
ASUS_LED(tled, "touchpad", 1); ASUS_LED(tled, "touchpad", 1);
...@@ -478,18 +472,20 @@ static enum led_brightness kled_led_get(struct led_classdev *led_cdev) ...@@ -478,18 +472,20 @@ static enum led_brightness kled_led_get(struct led_classdev *led_cdev)
return asus_kled_lvl(asus); return asus_kled_lvl(asus);
} }
#define ASUS_LED_UNREGISTER(object) \
if (object##_led.dev) \
led_classdev_unregister(&object##_led)
static void asus_led_exit(struct asus_laptop *asus) static void asus_led_exit(struct asus_laptop *asus)
{ {
ASUS_LED_UNREGISTER(mled); if (asus->leds.mled.dev)
ASUS_LED_UNREGISTER(tled); led_classdev_unregister(&asus->leds.mled);
ASUS_LED_UNREGISTER(pled); if (asus->leds.tled.dev)
ASUS_LED_UNREGISTER(rled); led_classdev_unregister(&asus->leds.tled);
ASUS_LED_UNREGISTER(gled); if (asus->leds.pled.dev)
ASUS_LED_UNREGISTER(kled); led_classdev_unregister(&asus->leds.pled);
if (asus->leds.rled.dev)
led_classdev_unregister(&asus->leds.rled);
if (asus->leds.gled.dev)
led_classdev_unregister(&asus->leds.gled);
if (asus->leds.kled.dev)
led_classdev_unregister(&asus->leds.kled);
if (asus->leds.workqueue) { if (asus->leds.workqueue) {
destroy_workqueue(asus->leds.workqueue); destroy_workqueue(asus->leds.workqueue);
asus->leds.workqueue = NULL; asus->leds.workqueue = NULL;
...@@ -507,6 +503,7 @@ static void asus_led_exit(struct asus_laptop *asus) ...@@ -507,6 +503,7 @@ static void asus_led_exit(struct asus_laptop *asus)
INIT_WORK(&asus->leds.object##_work, object##_led_update); \ INIT_WORK(&asus->leds.object##_work, object##_led_update); \
ldev->name = "asus::" _name; \ ldev->name = "asus::" _name; \
ldev->brightness_set = object##_led_set; \ ldev->brightness_set = object##_led_set; \
ldev->brightness_get = object##_led_get; \
ldev->max_brightness = max; \ ldev->max_brightness = max; \
rv = led_classdev_register(&asus->platform_device->dev, ldev); \ rv = led_classdev_register(&asus->platform_device->dev, ldev); \
if (rv) \ if (rv) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment