提交 83a8af0d 编写于 作者: M Marek Vasut 提交者: Anton Vorontsov

wm97xx_battery: Convert to dev_pm_ops

Signed-off-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
上级 7c87942a
...@@ -145,20 +145,22 @@ static irqreturn_t wm97xx_chrg_irq(int irq, void *data) ...@@ -145,20 +145,22 @@ static irqreturn_t wm97xx_chrg_irq(int irq, void *data)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int wm97xx_bat_suspend(struct platform_device *dev, pm_message_t state) static int wm97xx_bat_suspend(struct device *dev)
{ {
flush_scheduled_work(); flush_scheduled_work();
return 0; return 0;
} }
static int wm97xx_bat_resume(struct platform_device *dev) static int wm97xx_bat_resume(struct device *dev)
{ {
schedule_work(&bat_work); schedule_work(&bat_work);
return 0; return 0;
} }
#else
#define wm97xx_bat_suspend NULL static struct dev_pm_ops wm97xx_bat_pm_ops = {
#define wm97xx_bat_resume NULL .suspend = wm97xx_bat_suspend,
.resume = wm97xx_bat_resume,
};
#endif #endif
static int __devinit wm97xx_bat_probe(struct platform_device *dev) static int __devinit wm97xx_bat_probe(struct platform_device *dev)
...@@ -281,11 +283,12 @@ static struct platform_driver wm97xx_bat_driver = { ...@@ -281,11 +283,12 @@ static struct platform_driver wm97xx_bat_driver = {
.driver = { .driver = {
.name = "wm97xx-battery", .name = "wm97xx-battery",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &wm97xx_bat_pm_ops,
#endif
}, },
.probe = wm97xx_bat_probe, .probe = wm97xx_bat_probe,
.remove = __devexit_p(wm97xx_bat_remove), .remove = __devexit_p(wm97xx_bat_remove),
.suspend = wm97xx_bat_suspend,
.resume = wm97xx_bat_resume,
}; };
static int __init wm97xx_bat_init(void) static int __init wm97xx_bat_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册