diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-01-08 12:55:03 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-01-08 12:55:03 -0500 |
commit | 859cb7f2a4244ea6da206d3fe9cc8a6810947a68 (patch) | |
tree | 3389fe6c191418d6acc30d84e11a0760608f7431 /drivers/leds/leds-wrap.c | |
parent | 0081e8020ebd814a99e45720a10e869a54ee08a6 (diff) |
leds: Add suspend/resume to the core class
Add suspend/resume to the core class and remove all the now unneeded
code from various drivers. Originally the class code couldn't support
suspend/resume but since class_device can there is no reason for
each driver doing its own suspend/resume anymore.
Diffstat (limited to 'drivers/leds/leds-wrap.c')
-rw-r--r-- | drivers/leds/leds-wrap.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/drivers/leds/leds-wrap.c b/drivers/leds/leds-wrap.c index 2f3aa87f2a1f..2982c86ac4cf 100644 --- a/drivers/leds/leds-wrap.c +++ b/drivers/leds/leds-wrap.c | |||
@@ -56,40 +56,21 @@ static struct led_classdev wrap_power_led = { | |||
56 | .name = "wrap::power", | 56 | .name = "wrap::power", |
57 | .brightness_set = wrap_power_led_set, | 57 | .brightness_set = wrap_power_led_set, |
58 | .default_trigger = "default-on", | 58 | .default_trigger = "default-on", |
59 | .flags = LED_CORE_SUSPENDRESUME, | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | static struct led_classdev wrap_error_led = { | 62 | static struct led_classdev wrap_error_led = { |
62 | .name = "wrap::error", | 63 | .name = "wrap::error", |
63 | .brightness_set = wrap_error_led_set, | 64 | .brightness_set = wrap_error_led_set, |
65 | .flags = LED_CORE_SUSPENDRESUME, | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | static struct led_classdev wrap_extra_led = { | 68 | static struct led_classdev wrap_extra_led = { |
67 | .name = "wrap::extra", | 69 | .name = "wrap::extra", |
68 | .brightness_set = wrap_extra_led_set, | 70 | .brightness_set = wrap_extra_led_set, |
71 | .flags = LED_CORE_SUSPENDRESUME, | ||
69 | }; | 72 | }; |
70 | 73 | ||
71 | #ifdef CONFIG_PM | ||
72 | static int wrap_led_suspend(struct platform_device *dev, | ||
73 | pm_message_t state) | ||
74 | { | ||
75 | led_classdev_suspend(&wrap_power_led); | ||
76 | led_classdev_suspend(&wrap_error_led); | ||
77 | led_classdev_suspend(&wrap_extra_led); | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | static int wrap_led_resume(struct platform_device *dev) | ||
82 | { | ||
83 | led_classdev_resume(&wrap_power_led); | ||
84 | led_classdev_resume(&wrap_error_led); | ||
85 | led_classdev_resume(&wrap_extra_led); | ||
86 | return 0; | ||
87 | } | ||
88 | #else | ||
89 | #define wrap_led_suspend NULL | ||
90 | #define wrap_led_resume NULL | ||
91 | #endif | ||
92 | |||
93 | static int wrap_led_probe(struct platform_device *pdev) | 74 | static int wrap_led_probe(struct platform_device *pdev) |
94 | { | 75 | { |
95 | int ret; | 76 | int ret; |
@@ -127,8 +108,6 @@ static int wrap_led_remove(struct platform_device *pdev) | |||
127 | static struct platform_driver wrap_led_driver = { | 108 | static struct platform_driver wrap_led_driver = { |
128 | .probe = wrap_led_probe, | 109 | .probe = wrap_led_probe, |
129 | .remove = wrap_led_remove, | 110 | .remove = wrap_led_remove, |
130 | .suspend = wrap_led_suspend, | ||
131 | .resume = wrap_led_resume, | ||
132 | .driver = { | 111 | .driver = { |
133 | .name = DRVNAME, | 112 | .name = DRVNAME, |
134 | .owner = THIS_MODULE, | 113 | .owner = THIS_MODULE, |