diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2010-01-24 05:15:42 -0500 |
---|---|---|
committer | Corentin Chary <corentincj@iksaif.net> | 2010-02-28 13:35:12 -0500 |
commit | 75747129a994463e36c2516e8071771427d8494b (patch) | |
tree | 9a3d5ae569e6cc84b04b7523af9532ce6fe7f4e3 /drivers/platform | |
parent | a539df5e1548751e352990c518e88af50e6111b8 (diff) |
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: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 516add3c340e..ca144d251b00 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -371,13 +371,7 @@ static int asus_led_set(struct asus_laptop *asus, char *method, | |||
371 | enum led_brightness value); \ | 371 | enum led_brightness value); \ |
372 | static enum led_brightness object##_led_get( \ | 372 | static enum led_brightness object##_led_get( \ |
373 | struct led_classdev *led_cdev); \ | 373 | struct led_classdev *led_cdev); \ |
374 | static void object##_led_update(struct work_struct *ignored); \ | 374 | static void object##_led_update(struct work_struct *ignored); |
375 | static struct led_classdev object##_led = { \ | ||
376 | .name = "asus::" ledname, \ | ||
377 | .brightness_set = object##_led_set, \ | ||
378 | .brightness_get = object##_led_get, \ | ||
379 | .max_brightness = max \ | ||
380 | } | ||
381 | 375 | ||
382 | ASUS_LED(mled, "mail", 1); | 376 | ASUS_LED(mled, "mail", 1); |
383 | ASUS_LED(tled, "touchpad", 1); | 377 | ASUS_LED(tled, "touchpad", 1); |
@@ -478,18 +472,20 @@ static enum led_brightness kled_led_get(struct led_classdev *led_cdev) | |||
478 | return asus_kled_lvl(asus); | 472 | return asus_kled_lvl(asus); |
479 | } | 473 | } |
480 | 474 | ||
481 | #define ASUS_LED_UNREGISTER(object) \ | ||
482 | if (object##_led.dev) \ | ||
483 | led_classdev_unregister(&object##_led) | ||
484 | |||
485 | static void asus_led_exit(struct asus_laptop *asus) | 475 | static void asus_led_exit(struct asus_laptop *asus) |
486 | { | 476 | { |
487 | ASUS_LED_UNREGISTER(mled); | 477 | if (asus->leds.mled.dev) |
488 | ASUS_LED_UNREGISTER(tled); | 478 | led_classdev_unregister(&asus->leds.mled); |
489 | ASUS_LED_UNREGISTER(pled); | 479 | if (asus->leds.tled.dev) |
490 | ASUS_LED_UNREGISTER(rled); | 480 | led_classdev_unregister(&asus->leds.tled); |
491 | ASUS_LED_UNREGISTER(gled); | 481 | if (asus->leds.pled.dev) |
492 | ASUS_LED_UNREGISTER(kled); | 482 | led_classdev_unregister(&asus->leds.pled); |
483 | if (asus->leds.rled.dev) | ||
484 | led_classdev_unregister(&asus->leds.rled); | ||
485 | if (asus->leds.gled.dev) | ||
486 | led_classdev_unregister(&asus->leds.gled); | ||
487 | if (asus->leds.kled.dev) | ||
488 | led_classdev_unregister(&asus->leds.kled); | ||
493 | if (asus->leds.workqueue) { | 489 | if (asus->leds.workqueue) { |
494 | destroy_workqueue(asus->leds.workqueue); | 490 | destroy_workqueue(asus->leds.workqueue); |
495 | asus->leds.workqueue = NULL; | 491 | asus->leds.workqueue = NULL; |
@@ -507,6 +503,7 @@ static void asus_led_exit(struct asus_laptop *asus) | |||
507 | INIT_WORK(&asus->leds.object##_work, object##_led_update); \ | 503 | INIT_WORK(&asus->leds.object##_work, object##_led_update); \ |
508 | ldev->name = "asus::" _name; \ | 504 | ldev->name = "asus::" _name; \ |
509 | ldev->brightness_set = object##_led_set; \ | 505 | ldev->brightness_set = object##_led_set; \ |
506 | ldev->brightness_get = object##_led_get; \ | ||
510 | ldev->max_brightness = max; \ | 507 | ldev->max_brightness = max; \ |
511 | rv = led_classdev_register(&asus->platform_device->dev, ldev); \ | 508 | rv = led_classdev_register(&asus->platform_device->dev, ldev); \ |
512 | if (rv) \ | 509 | if (rv) \ |