aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/char/watchdog
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff)
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 3625b2601b42..b732020acadb 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -464,32 +464,28 @@ static void s3c2410wdt_shutdown(struct device *dev)
464static unsigned long wtcon_save; 464static unsigned long wtcon_save;
465static unsigned long wtdat_save; 465static unsigned long wtdat_save;
466 466
467static int s3c2410wdt_suspend(struct device *dev, pm_message_t state, u32 level) 467static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
468{ 468{
469 if (level == SUSPEND_POWER_DOWN) { 469 /* Save watchdog state, and turn it off. */
470 /* Save watchdog state, and turn it off. */ 470 wtcon_save = readl(wdt_base + S3C2410_WTCON);
471 wtcon_save = readl(wdt_base + S3C2410_WTCON); 471 wtdat_save = readl(wdt_base + S3C2410_WTDAT);
472 wtdat_save = readl(wdt_base + S3C2410_WTDAT);
473 472
474 /* Note that WTCNT doesn't need to be saved. */ 473 /* Note that WTCNT doesn't need to be saved. */
475 s3c2410wdt_stop(); 474 s3c2410wdt_stop();
476 }
477 475
478 return 0; 476 return 0;
479} 477}
480 478
481static int s3c2410wdt_resume(struct device *dev, u32 level) 479static int s3c2410wdt_resume(struct device *dev)
482{ 480{
483 if (level == RESUME_POWER_ON) { 481 /* Restore watchdog state. */
484 /* Restore watchdog state. */
485 482
486 writel(wtdat_save, wdt_base + S3C2410_WTDAT); 483 writel(wtdat_save, wdt_base + S3C2410_WTDAT);
487 writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ 484 writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
488 writel(wtcon_save, wdt_base + S3C2410_WTCON); 485 writel(wtcon_save, wdt_base + S3C2410_WTCON);
489 486
490 printk(KERN_INFO PFX "watchdog %sabled\n", 487 printk(KERN_INFO PFX "watchdog %sabled\n",
491 (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); 488 (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
492 }
493 489
494 return 0; 490 return 0;
495} 491}