diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2009-08-21 18:36:43 -0400 |
---|---|---|
committer | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-04 12:21:08 -0400 |
commit | 83a8af0d31cfa6c728a68c00f6b1b518e2dcc03d (patch) | |
tree | 92a98ecd1a085dde0d64eee6775e3b367ab0527b /drivers | |
parent | 7c87942aef52d2120e95ff1dec739998b9f95a78 (diff) |
wm97xx_battery: Convert to dev_pm_ops
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/wm97xx_battery.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c index cad1ba283bfd..c552082c8128 100644 --- a/drivers/power/wm97xx_battery.c +++ b/drivers/power/wm97xx_battery.c | |||
@@ -145,20 +145,22 @@ static irqreturn_t wm97xx_chrg_irq(int irq, void *data) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | #ifdef CONFIG_PM | 147 | #ifdef CONFIG_PM |
148 | static int wm97xx_bat_suspend(struct platform_device *dev, pm_message_t state) | 148 | static int wm97xx_bat_suspend(struct device *dev) |
149 | { | 149 | { |
150 | flush_scheduled_work(); | 150 | flush_scheduled_work(); |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | 153 | ||
154 | static int wm97xx_bat_resume(struct platform_device *dev) | 154 | static int wm97xx_bat_resume(struct device *dev) |
155 | { | 155 | { |
156 | schedule_work(&bat_work); | 156 | schedule_work(&bat_work); |
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
159 | #else | 159 | |
160 | #define wm97xx_bat_suspend NULL | 160 | static struct dev_pm_ops wm97xx_bat_pm_ops = { |
161 | #define wm97xx_bat_resume NULL | 161 | .suspend = wm97xx_bat_suspend, |
162 | .resume = wm97xx_bat_resume, | ||
163 | }; | ||
162 | #endif | 164 | #endif |
163 | 165 | ||
164 | static int __devinit wm97xx_bat_probe(struct platform_device *dev) | 166 | static int __devinit wm97xx_bat_probe(struct platform_device *dev) |
@@ -281,11 +283,12 @@ static struct platform_driver wm97xx_bat_driver = { | |||
281 | .driver = { | 283 | .driver = { |
282 | .name = "wm97xx-battery", | 284 | .name = "wm97xx-battery", |
283 | .owner = THIS_MODULE, | 285 | .owner = THIS_MODULE, |
286 | #ifdef CONFIG_PM | ||
287 | .pm = &wm97xx_bat_pm_ops, | ||
288 | #endif | ||
284 | }, | 289 | }, |
285 | .probe = wm97xx_bat_probe, | 290 | .probe = wm97xx_bat_probe, |
286 | .remove = __devexit_p(wm97xx_bat_remove), | 291 | .remove = __devexit_p(wm97xx_bat_remove), |
287 | .suspend = wm97xx_bat_suspend, | ||
288 | .resume = wm97xx_bat_resume, | ||
289 | }; | 292 | }; |
290 | 293 | ||
291 | static int __init wm97xx_bat_init(void) | 294 | static int __init wm97xx_bat_init(void) |