summaryrefslogtreecommitdiff
path: root/drivers/watchdog/s3c2410_wdt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 20:42:54 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 20:42:54 (GMT)
commit833e68340d108d88f4cb79b7d7223f6859d362ca (patch)
tree89f960431365ce2d47178c0620634b66979497fa /drivers/watchdog/s3c2410_wdt.c
parentc55244137306b626bc64023fd7160985443205a7 (diff)
parentcce78da76601b64305c050f602767bf58cebcf5d (diff)
downloadlinux-833e68340d108d88f4cb79b7d7223f6859d362ca.tar.xz
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck: - lots of devm_ conversions and cleanup - platform_set_drvdata cleanups - s3c2410: dev_err/dev_info + dev_pm_ops - watchdog_core: don't try to stop device if not running fix - wdrtas: use print_hex_dump - xilinx cleanups - orion_wdt fixes - softdog cleanup - hpwdt: check on UEFI bits - deletion of mpcore_wdt driver - addition of broadcom BCM2835 watchdog timer driver - addition of MEN A21 watcdog devices * git://www.linux-watchdog.org/linux-watchdog: (38 commits) watchdog: hpwdt: Add check for UEFI bits watchdog: softdog: remove replaceable ping operation watchdog: New watchdog driver for MEN A21 watchdogs Watchdog: fix clearing of the watchdog interrupt Watchdog: allow orion_wdt to be built for Dove watchdog: Add Broadcom BCM2835 watchdog timer driver watchdog: delete mpcore_wdt driver watchdog: xilinx: Setup the origin compatible string watchdog: xilinx: Fix driver header watchdog: wdrtas: don't use custom version of print_hex_dump watchdog: core: don't try to stop device if not running watchdog: jz4740: Pass device to clk_get watchdog: twl4030: Remove redundant platform_set_drvdata() watchdog: mpcore: Remove redundant platform_set_drvdata() watchdog: da9055: use platform_{get,set}_drvdata() watchdog: da9052: use platform_{get,set}_drvdata() watchdog: cpwd: use platform_{get,set}_drvdata() watchdog: s3c2410_wdt: convert s3c2410wdt to dev_pm_ops watchdog: s3c2410_wdt: use dev_err()/dev_info() instead of pr_err()/pr_info() watchdog: wm831x: use platform_{get,set}_drvdata() ...
Diffstat (limited to 'drivers/watchdog/s3c2410_wdt.c')
-rw-r--r--drivers/watchdog/s3c2410_wdt.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 3a9f696..6a22cf5 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -358,7 +358,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
ret = s3c2410wdt_cpufreq_register();
if (ret < 0) {
- pr_err("failed to register cpufreq\n");
+ dev_err(dev, "failed to register cpufreq\n");
goto err_clk;
}
@@ -448,12 +448,12 @@ static void s3c2410wdt_shutdown(struct platform_device *dev)
s3c2410wdt_stop(&s3c2410_wdd);
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static unsigned long wtcon_save;
static unsigned long wtdat_save;
-static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
+static int s3c2410wdt_suspend(struct device *dev)
{
/* Save watchdog state, and turn it off. */
wtcon_save = readl(wdt_base + S3C2410_WTCON);
@@ -465,7 +465,7 @@ static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-static int s3c2410wdt_resume(struct platform_device *dev)
+static int s3c2410wdt_resume(struct device *dev)
{
/* Restore watchdog state. */
@@ -473,16 +473,15 @@ static int s3c2410wdt_resume(struct platform_device *dev)
writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
writel(wtcon_save, wdt_base + S3C2410_WTCON);
- pr_info("watchdog %sabled\n",
+ dev_info(dev, "watchdog %sabled\n",
(wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
return 0;
}
+#endif
-#else
-#define s3c2410wdt_suspend NULL
-#define s3c2410wdt_resume NULL
-#endif /* CONFIG_PM */
+static SIMPLE_DEV_PM_OPS(s3c2410wdt_pm_ops, s3c2410wdt_suspend,
+ s3c2410wdt_resume);
#ifdef CONFIG_OF
static const struct of_device_id s3c2410_wdt_match[] = {
@@ -496,11 +495,10 @@ static struct platform_driver s3c2410wdt_driver = {
.probe = s3c2410wdt_probe,
.remove = s3c2410wdt_remove,
.shutdown = s3c2410wdt_shutdown,
- .suspend = s3c2410wdt_suspend,
- .resume = s3c2410wdt_resume,
.driver = {
.owner = THIS_MODULE,
.name = "s3c2410-wdt",
+ .pm = &s3c2410wdt_pm_ops,
.of_match_table = of_match_ptr(s3c2410_wdt_match),
},
};