diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-11 03:43:52 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-11 03:43:52 +0100 |
commit | 99cd7074891f87c49660e3b2880564324a4733ac (patch) | |
tree | 903d2665bcb445f1f265d1adf7a99f265bcefc15 /drivers/leds/led-class.c | |
parent | e8a9cbf6ae620d9e5ba9cb42001c033287a284a3 (diff) | |
parent | c59765042f53a79a7a65585042ff463b69cb248c (diff) |
Merge commit 'v2.6.29-rc1' into tracing/urgent
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r-- | drivers/leds/led-class.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 6c4a326176d..52f82e3ea13 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -91,9 +91,29 @@ void led_classdev_resume(struct led_classdev *led_cdev) } EXPORT_SYMBOL_GPL(led_classdev_resume); +static int led_suspend(struct device *dev, pm_message_t state) +{ + struct led_classdev *led_cdev = dev_get_drvdata(dev); + + if (led_cdev->flags & LED_CORE_SUSPENDRESUME) + led_classdev_suspend(led_cdev); + + return 0; +} + +static int led_resume(struct device *dev) +{ + struct led_classdev *led_cdev = dev_get_drvdata(dev); + + if (led_cdev->flags & LED_CORE_SUSPENDRESUME) + led_classdev_resume(led_cdev); + + return 0; +} + /** * led_classdev_register - register a new object of led_classdev class. - * @dev: The device to register. + * @parent: The device to register. * @led_cdev: the led_classdev structure for this device. */ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) @@ -174,6 +194,8 @@ static int __init leds_init(void) leds_class = class_create(THIS_MODULE, "leds"); if (IS_ERR(leds_class)) return PTR_ERR(leds_class); + leds_class->suspend = led_suspend; + leds_class->resume = led_resume; return 0; } |