From 019bec58be4e7d651b1d7a30e9d05137382017ae Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Aug 2009 00:36:43 +0200 Subject: [PATCH] --- yaml --- r: 165515 b: refs/heads/master c: 83a8af0d31cfa6c728a68c00f6b1b518e2dcc03d h: refs/heads/master i: 165513: f1d258eae80e2224c7fad2a1f7da21fb1855a35d 165511: 169811406f99c13c06f719d6faef072b2a361278 v: v3 --- [refs] | 2 +- trunk/drivers/power/wm97xx_battery.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index f8e132d64630..79bbd509e148 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7c87942aef52d2120e95ff1dec739998b9f95a78 +refs/heads/master: 83a8af0d31cfa6c728a68c00f6b1b518e2dcc03d diff --git a/trunk/drivers/power/wm97xx_battery.c b/trunk/drivers/power/wm97xx_battery.c index cad1ba283bfd..c552082c8128 100644 --- a/trunk/drivers/power/wm97xx_battery.c +++ b/trunk/drivers/power/wm97xx_battery.c @@ -145,20 +145,22 @@ static irqreturn_t wm97xx_chrg_irq(int irq, void *data) } #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(); return 0; } -static int wm97xx_bat_resume(struct platform_device *dev) +static int wm97xx_bat_resume(struct device *dev) { schedule_work(&bat_work); return 0; } -#else -#define wm97xx_bat_suspend NULL -#define wm97xx_bat_resume NULL + +static struct dev_pm_ops wm97xx_bat_pm_ops = { + .suspend = wm97xx_bat_suspend, + .resume = wm97xx_bat_resume, +}; #endif static int __devinit wm97xx_bat_probe(struct platform_device *dev) @@ -281,11 +283,12 @@ static struct platform_driver wm97xx_bat_driver = { .driver = { .name = "wm97xx-battery", .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &wm97xx_bat_pm_ops, +#endif }, .probe = wm97xx_bat_probe, .remove = __devexit_p(wm97xx_bat_remove), - .suspend = wm97xx_bat_suspend, - .resume = wm97xx_bat_resume, }; static int __init wm97xx_bat_init(void)