diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-25 12:54:17 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-08 06:30:09 -0400 |
commit | f4d1f2bed6fb7df12f8a99ccf16d537472a3d246 (patch) | |
tree | 35cdb9746d3f382a24841801da51cd3a01a7a35b | |
parent | b6d92b4a6bdb880b39789c677b952c53a437028d (diff) |
MIPS: sead3: Use generic suspend/resume for LEDs.
Setting the LED_CORE_SUSPENDRESUME flag causes the LED driver core to call
led_classdev_suspend/led_classdev_resume during suspend/resume. Since this is
exactly what the driver's custom suspend/resume callbacks do we can replace them
by setting the LED_CORE_SUSPENDRESUME flag.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
-rw-r--r-- | arch/mips/mti-sead3/leds-sead3.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/arch/mips/mti-sead3/leds-sead3.c b/arch/mips/mti-sead3/leds-sead3.c index 322148c353ed..0a168c948b01 100644 --- a/arch/mips/mti-sead3/leds-sead3.c +++ b/arch/mips/mti-sead3/leds-sead3.c | |||
@@ -34,33 +34,15 @@ static void sead3_fled_set(struct led_classdev *led_cdev, | |||
34 | static struct led_classdev sead3_pled = { | 34 | static struct led_classdev sead3_pled = { |
35 | .name = "sead3::pled", | 35 | .name = "sead3::pled", |
36 | .brightness_set = sead3_pled_set, | 36 | .brightness_set = sead3_pled_set, |
37 | .flags = LED_CORE_SUSPENDRESUME, | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | static struct led_classdev sead3_fled = { | 40 | static struct led_classdev sead3_fled = { |
40 | .name = "sead3::fled", | 41 | .name = "sead3::fled", |
41 | .brightness_set = sead3_fled_set, | 42 | .brightness_set = sead3_fled_set, |
43 | .flags = LED_CORE_SUSPENDRESUME, | ||
42 | }; | 44 | }; |
43 | 45 | ||
44 | #ifdef CONFIG_PM | ||
45 | static int sead3_led_suspend(struct platform_device *dev, | ||
46 | pm_message_t state) | ||
47 | { | ||
48 | led_classdev_suspend(&sead3_pled); | ||
49 | led_classdev_suspend(&sead3_fled); | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static int sead3_led_resume(struct platform_device *dev) | ||
54 | { | ||
55 | led_classdev_resume(&sead3_pled); | ||
56 | led_classdev_resume(&sead3_fled); | ||
57 | return 0; | ||
58 | } | ||
59 | #else | ||
60 | #define sead3_led_suspend NULL | ||
61 | #define sead3_led_resume NULL | ||
62 | #endif | ||
63 | |||
64 | static int sead3_led_probe(struct platform_device *pdev) | 46 | static int sead3_led_probe(struct platform_device *pdev) |
65 | { | 47 | { |
66 | int ret; | 48 | int ret; |
@@ -86,8 +68,6 @@ static int sead3_led_remove(struct platform_device *pdev) | |||
86 | static struct platform_driver sead3_led_driver = { | 68 | static struct platform_driver sead3_led_driver = { |
87 | .probe = sead3_led_probe, | 69 | .probe = sead3_led_probe, |
88 | .remove = sead3_led_remove, | 70 | .remove = sead3_led_remove, |
89 | .suspend = sead3_led_suspend, | ||
90 | .resume = sead3_led_resume, | ||
91 | .driver = { | 71 | .driver = { |
92 | .name = DRVNAME, | 72 | .name = DRVNAME, |
93 | .owner = THIS_MODULE, | 73 | .owner = THIS_MODULE, |