[PATCH 10/15] watchdog/mpcore_wdt: Add support for dev_pm_ops interface
Viresh Kumar
viresh.kumar at st.com
Wed Mar 7 05:27:51 EST 2012
This patch adds dev_pm_ops support for standby/slepp/hibernate.
Signed-off-by: Viresh Kumar <viresh.kumar at st.com>
---
drivers/watchdog/mpcore_wdt.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index e02c02b..a099418 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
+#include <linux/pm.h>
#include <linux/reboot.h>
#include <linux/slab.h>
#include <linux/types.h>
@@ -384,40 +385,39 @@ static int __devexit mpcore_wdt_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int mpcore_wdt_suspend(struct platform_device *pdev, pm_message_t msg)
+static int mpcore_wdt_suspend(struct device *dev)
{
- struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
+ struct mpcore_wdt *wdt = dev_get_drvdata(dev);
mpcore_wdt_stop(wdt); /* Turn the WDT off */
return 0;
}
-static int mpcore_wdt_resume(struct platform_device *pdev)
+static int mpcore_wdt_resume(struct device *dev)
{
- struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
+ struct mpcore_wdt *wdt = dev_get_drvdata(dev);
/* re-activate timer */
if (test_bit(0, &wdt->timer_alive))
mpcore_wdt_start(wdt);
return 0;
}
-#else
-#define mpcore_wdt_suspend NULL
-#define mpcore_wdt_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(mpcore_wdt_dev_pm_ops, mpcore_wdt_suspend,
+ mpcore_wdt_resume);
+
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:mpcore_wdt");
static struct platform_driver mpcore_wdt_driver = {
.probe = mpcore_wdt_probe,
.remove = __devexit_p(mpcore_wdt_remove),
- .suspend = mpcore_wdt_suspend,
- .resume = mpcore_wdt_resume,
.shutdown = mpcore_wdt_shutdown,
.driver = {
.owner = THIS_MODULE,
.name = "mpcore_wdt",
+ .pm = &mpcore_wdt_dev_pm_ops,
},
};
--
1.7.8.110.g4cb5d
More information about the linux-arm-kernel
mailing list