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-hp6xx.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-hp6xx.c')
-rw-r--r-- | drivers/leds/leds-hp6xx.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/leds/leds-hp6xx.c b/drivers/leds/leds-hp6xx.c index e8fb1baf8a50..e4ce1fd46338 100644 --- a/drivers/leds/leds-hp6xx.c +++ b/drivers/leds/leds-hp6xx.c | |||
@@ -45,30 +45,16 @@ static struct led_classdev hp6xx_red_led = { | |||
45 | .name = "hp6xx:red", | 45 | .name = "hp6xx:red", |
46 | .default_trigger = "hp6xx-charge", | 46 | .default_trigger = "hp6xx-charge", |
47 | .brightness_set = hp6xxled_red_set, | 47 | .brightness_set = hp6xxled_red_set, |
48 | .flags = LED_CORE_SUSPENDRESUME, | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | static struct led_classdev hp6xx_green_led = { | 51 | static struct led_classdev hp6xx_green_led = { |
51 | .name = "hp6xx:green", | 52 | .name = "hp6xx:green", |
52 | .default_trigger = "ide-disk", | 53 | .default_trigger = "ide-disk", |
53 | .brightness_set = hp6xxled_green_set, | 54 | .brightness_set = hp6xxled_green_set, |
55 | .flags = LED_CORE_SUSPENDRESUME, | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | #ifdef CONFIG_PM | ||
57 | static int hp6xxled_suspend(struct platform_device *dev, pm_message_t state) | ||
58 | { | ||
59 | led_classdev_suspend(&hp6xx_red_led); | ||
60 | led_classdev_suspend(&hp6xx_green_led); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static int hp6xxled_resume(struct platform_device *dev) | ||
65 | { | ||
66 | led_classdev_resume(&hp6xx_red_led); | ||
67 | led_classdev_resume(&hp6xx_green_led); | ||
68 | return 0; | ||
69 | } | ||
70 | #endif | ||
71 | |||
72 | static int hp6xxled_probe(struct platform_device *pdev) | 58 | static int hp6xxled_probe(struct platform_device *pdev) |
73 | { | 59 | { |
74 | int ret; | 60 | int ret; |
@@ -98,10 +84,6 @@ MODULE_ALIAS("platform:hp6xx-led"); | |||
98 | static struct platform_driver hp6xxled_driver = { | 84 | static struct platform_driver hp6xxled_driver = { |
99 | .probe = hp6xxled_probe, | 85 | .probe = hp6xxled_probe, |
100 | .remove = hp6xxled_remove, | 86 | .remove = hp6xxled_remove, |
101 | #ifdef CONFIG_PM | ||
102 | .suspend = hp6xxled_suspend, | ||
103 | .resume = hp6xxled_resume, | ||
104 | #endif | ||
105 | .driver = { | 87 | .driver = { |
106 | .name = "hp6xx-led", | 88 | .name = "hp6xx-led", |
107 | .owner = THIS_MODULE, | 89 | .owner = THIS_MODULE, |