aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2005-08-17 09:04:52 +0200
committerWim Van Sebroeck <wim@iguana.be>2005-09-03 13:56:06 +0200
commit94f1e9f316b10972b77a64344006c3bf8a4929b4 (patch)
tree0671740ee1e05172d4254b322bcef62e7e945ee8 /drivers
parentaf4bb822bc65efb087cd36b83789f22161a6515b (diff)
downloadkernel_samsung_aries-94f1e9f316b10972b77a64344006c3bf8a4929b4.zip
kernel_samsung_aries-94f1e9f316b10972b77a64344006c3bf8a4929b4.tar.gz
kernel_samsung_aries-94f1e9f316b10972b77a64344006c3bf8a4929b4.tar.bz2
[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>
Diffstat (limited to 'drivers')
-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 5224357..8b292bf 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -30,6 +30,7 @@
* 11-Jan-2005 BJD Fixed divide-by-2 in timeout code
*
* 25-Jan-2005 DA Added suspend/resume support
+ * Replaced reboot notifier with .shutdown method
*
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
*/
@@ -42,8 +43,6 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/fs.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/interrupt.h>
@@ -319,20 +318,6 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
}
}
-/*
- * Notifier for system down
- */
-
-static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code,
- void *unused)
-{
- if(code==SYS_DOWN || code==SYS_HALT) {
- /* Turn the WDT off */
- s3c2410wdt_stop();
- }
- return NOTIFY_DONE;
-}
-
/* kernel interface */
static struct file_operations s3c2410wdt_fops = {
@@ -350,10 +335,6 @@ static struct miscdevice s3c2410wdt_miscdev = {
.fops = &s3c2410wdt_fops,
};
-static struct notifier_block s3c2410wdt_notifier = {
- .notifier_call = s3c2410wdt_notify_sys,
-};
-
/* interrupt handler code */
static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
@@ -434,18 +415,10 @@ static int s3c2410wdt_probe(struct device *dev)
}
}
- ret = register_reboot_notifier(&s3c2410wdt_notifier);
- if (ret) {
- printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n",
- ret);
- return ret;
- }
-
ret = misc_register(&s3c2410wdt_miscdev);
if (ret) {
printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
WATCHDOG_MINOR, ret);
- unregister_reboot_notifier(&s3c2410wdt_notifier);
return ret;
}
@@ -481,6 +454,11 @@ static int s3c2410wdt_remove(struct device *dev)
return 0;
}
+static void s3c2410wdt_shutdown(struct device *dev)
+{
+ s3c2410wdt_stop();
+}
+
#ifdef CONFIG_PM
static unsigned long wtcon_save;
@@ -527,6 +505,7 @@ static struct device_driver s3c2410wdt_driver = {
.bus = &platform_bus_type,
.probe = s3c2410wdt_probe,
.remove = s3c2410wdt_remove,
+ .shutdown = s3c2410wdt_shutdown,
.suspend = s3c2410wdt_suspend,
.resume = s3c2410wdt_resume,
};
@@ -543,7 +522,6 @@ static int __init watchdog_init(void)
static void __exit watchdog_exit(void)
{
driver_unregister(&s3c2410wdt_driver);
- unregister_reboot_notifier(&s3c2410wdt_notifier);
}
module_init(watchdog_init);