Commit ad83c6cb authored by Heiko Stübner's avatar Heiko Stübner Committed by Wim Van Sebroeck

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: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 1213959d
...@@ -252,7 +252,7 @@ static int dw_wdt_release(struct inode *inode, struct file *filp) ...@@ -252,7 +252,7 @@ static int dw_wdt_release(struct inode *inode, struct file *filp)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int dw_wdt_suspend(struct device *dev) static int dw_wdt_suspend(struct device *dev)
{ {
clk_disable(dw_wdt.clk); clk_disable(dw_wdt.clk);
...@@ -271,12 +271,9 @@ static int dw_wdt_resume(struct device *dev) ...@@ -271,12 +271,9 @@ static int dw_wdt_resume(struct device *dev)
return 0; return 0;
} }
#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops dw_wdt_pm_ops = { static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume);
.suspend = dw_wdt_suspend,
.resume = dw_wdt_resume,
};
#endif /* CONFIG_PM */
static const struct file_operations wdt_fops = { static const struct file_operations wdt_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -346,9 +343,7 @@ static struct platform_driver dw_wdt_driver = { ...@@ -346,9 +343,7 @@ static struct platform_driver dw_wdt_driver = {
.driver = { .driver = {
.name = "dw_wdt", .name = "dw_wdt",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &dw_wdt_pm_ops, .pm = &dw_wdt_pm_ops,
#endif /* CONFIG_PM */
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment