diff options
author | Heiko Stübner <heiko@sntech.de> | 2013-06-26 14:03:52 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-11-17 13:30:06 -0500 |
commit | ad83c6cbf30eba322fbc822453316a4954d9b607 (patch) | |
tree | faa77dd0259b92a2a35307f6d7032ae92b8d7983 /drivers/watchdog/dw_wdt.c | |
parent | 1213959d4ad2f523290d0d7c94f712edef63852c (diff) |
watchdog: dw_wdt: convert to SIMPLE_DEV_PM_OPS
The dw_wdt only provides PM_SLEEP operations, so convert the driver
to use SIMPLE_DEV_PM_OPS instead of populating the struct manually.
This has the added effect of simplifying the CONFIG_PM ifdefs.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/dw_wdt.c')
-rw-r--r-- | drivers/watchdog/dw_wdt.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index e621098bf663..4d3906d7c9a5 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
@@ -252,7 +252,7 @@ static int dw_wdt_release(struct inode *inode, struct file *filp) | |||
252 | return 0; | 252 | return 0; |
253 | } | 253 | } |
254 | 254 | ||
255 | #ifdef CONFIG_PM | 255 | #ifdef CONFIG_PM_SLEEP |
256 | static int dw_wdt_suspend(struct device *dev) | 256 | static int dw_wdt_suspend(struct device *dev) |
257 | { | 257 | { |
258 | clk_disable(dw_wdt.clk); | 258 | clk_disable(dw_wdt.clk); |
@@ -271,12 +271,9 @@ static int dw_wdt_resume(struct device *dev) | |||
271 | 271 | ||
272 | return 0; | 272 | return 0; |
273 | } | 273 | } |
274 | #endif /* CONFIG_PM_SLEEP */ | ||
274 | 275 | ||
275 | static const struct dev_pm_ops dw_wdt_pm_ops = { | 276 | static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume); |
276 | .suspend = dw_wdt_suspend, | ||
277 | .resume = dw_wdt_resume, | ||
278 | }; | ||
279 | #endif /* CONFIG_PM */ | ||
280 | 277 | ||
281 | static const struct file_operations wdt_fops = { | 278 | static const struct file_operations wdt_fops = { |
282 | .owner = THIS_MODULE, | 279 | .owner = THIS_MODULE, |
@@ -346,9 +343,7 @@ static struct platform_driver dw_wdt_driver = { | |||
346 | .driver = { | 343 | .driver = { |
347 | .name = "dw_wdt", | 344 | .name = "dw_wdt", |
348 | .owner = THIS_MODULE, | 345 | .owner = THIS_MODULE, |
349 | #ifdef CONFIG_PM | ||
350 | .pm = &dw_wdt_pm_ops, | 346 | .pm = &dw_wdt_pm_ops, |
351 | #endif /* CONFIG_PM */ | ||
352 | }, | 347 | }, |
353 | }; | 348 | }; |
354 | 349 | ||