Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Heiko Stübner and committed by
Wim Van Sebroeck
ad83c6cb 1213959d

+3 -8
+3 -8
drivers/watchdog/dw_wdt.c
··· 252 252 return 0; 253 253 } 254 254 255 - #ifdef CONFIG_PM 255 + #ifdef CONFIG_PM_SLEEP 256 256 static int dw_wdt_suspend(struct device *dev) 257 257 { 258 258 clk_disable(dw_wdt.clk); ··· 271 271 272 272 return 0; 273 273 } 274 + #endif /* CONFIG_PM_SLEEP */ 274 275 275 - static const struct dev_pm_ops dw_wdt_pm_ops = { 276 - .suspend = dw_wdt_suspend, 277 - .resume = dw_wdt_resume, 278 - }; 279 - #endif /* CONFIG_PM */ 276 + static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume); 280 277 281 278 static const struct file_operations wdt_fops = { 282 279 .owner = THIS_MODULE, ··· 343 346 .driver = { 344 347 .name = "dw_wdt", 345 348 .owner = THIS_MODULE, 346 - #ifdef CONFIG_PM 347 349 .pm = &dw_wdt_pm_ops, 348 - #endif /* CONFIG_PM */ 349 350 }, 350 351 }; 351 352