aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2005-08-17 03:04:52 -0400
committerWim Van Sebroeck <wim@iguana.be>2005-09-03 07:56:06 -0400
commit94f1e9f316b10972b77a64344006c3bf8a4929b4 (patch)
tree0671740ee1e05172d4254b322bcef62e7e945ee8
parentaf4bb822bc65efb087cd36b83789f22161a6515b (diff)
[WATCHDOG] s3c2410 watchdog - replace reboot notifier
Patch from Dimitry Andric <dimitry.andric@tomtom.com> Change to using platfrom driver's .shutdown method instead of an reboot notifier Signed-off-by: Dimitry Andric <dimitry.andric@tomtom.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 522435782e73..8b292bf343c4 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -30,6 +30,7 @@
30 * 11-Jan-2005 BJD Fixed divide-by-2 in timeout code 30 * 11-Jan-2005 BJD Fixed divide-by-2 in timeout code
31 * 31 *
32 * 25-Jan-2005 DA Added suspend/resume support 32 * 25-Jan-2005 DA Added suspend/resume support
33 * Replaced reboot notifier with .shutdown method
33 * 34 *
34 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 35 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
35*/ 36*/
@@ -42,8 +43,6 @@
42#include <linux/miscdevice.h> 43#include <linux/miscdevice.h>
43#include <linux/watchdog.h> 44#include <linux/watchdog.h>
44#include <linux/fs.h> 45#include <linux/fs.h>
45#include <linux/notifier.h>
46#include <linux/reboot.h>
47#include <linux/init.h> 46#include <linux/init.h>
48#include <linux/device.h> 47#include <linux/device.h>
49#include <linux/interrupt.h> 48#include <linux/interrupt.h>
@@ -319,20 +318,6 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
319 } 318 }
320} 319}
321 320
322/*
323 * Notifier for system down
324 */
325
326static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code,
327 void *unused)
328{
329 if(code==SYS_DOWN || code==SYS_HALT) {
330 /* Turn the WDT off */
331 s3c2410wdt_stop();
332 }
333 return NOTIFY_DONE;
334}
335
336/* kernel interface */ 321/* kernel interface */
337 322
338static struct file_operations s3c2410wdt_fops = { 323static struct file_operations s3c2410wdt_fops = {
@@ -350,10 +335,6 @@ static struct miscdevice s3c2410wdt_miscdev = {
350 .fops = &s3c2410wdt_fops, 335 .fops = &s3c2410wdt_fops,
351}; 336};
352 337
353static struct notifier_block s3c2410wdt_notifier = {
354 .notifier_call = s3c2410wdt_notify_sys,
355};
356
357/* interrupt handler code */ 338/* interrupt handler code */
358 339
359static irqreturn_t s3c2410wdt_irq(int irqno, void *param, 340static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
@@ -434,18 +415,10 @@ static int s3c2410wdt_probe(struct device *dev)
434 } 415 }
435 } 416 }
436 417
437 ret = register_reboot_notifier(&s3c2410wdt_notifier);
438 if (ret) {
439 printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n",
440 ret);
441 return ret;
442 }
443
444 ret = misc_register(&s3c2410wdt_miscdev); 418 ret = misc_register(&s3c2410wdt_miscdev);
445 if (ret) { 419 if (ret) {
446 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", 420 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
447 WATCHDOG_MINOR, ret); 421 WATCHDOG_MINOR, ret);
448 unregister_reboot_notifier(&s3c2410wdt_notifier);
449 return ret; 422 return ret;
450 } 423 }
451 424
@@ -481,6 +454,11 @@ static int s3c2410wdt_remove(struct device *dev)
481 return 0; 454 return 0;
482} 455}
483 456
457static void s3c2410wdt_shutdown(struct device *dev)
458{
459 s3c2410wdt_stop();
460}
461
484#ifdef CONFIG_PM 462#ifdef CONFIG_PM
485 463
486static unsigned long wtcon_save; 464static unsigned long wtcon_save;
@@ -527,6 +505,7 @@ static struct device_driver s3c2410wdt_driver = {
527 .bus = &platform_bus_type, 505 .bus = &platform_bus_type,
528 .probe = s3c2410wdt_probe, 506 .probe = s3c2410wdt_probe,
529 .remove = s3c2410wdt_remove, 507 .remove = s3c2410wdt_remove,
508 .shutdown = s3c2410wdt_shutdown,
530 .suspend = s3c2410wdt_suspend, 509 .suspend = s3c2410wdt_suspend,
531 .resume = s3c2410wdt_resume, 510 .resume = s3c2410wdt_resume,
532}; 511};
@@ -543,7 +522,6 @@ static int __init watchdog_init(void)
543static void __exit watchdog_exit(void) 522static void __exit watchdog_exit(void)
544{ 523{
545 driver_unregister(&s3c2410wdt_driver); 524 driver_unregister(&s3c2410wdt_driver);
546 unregister_reboot_notifier(&s3c2410wdt_notifier);
547} 525}
548 526
549module_init(watchdog_init); 527module_init(watchdog_init);