#include <linux/types.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/io.h>
}
/*
- * Notifier for system down
- */
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
- void *unused)
-{
- if (code == SYS_DOWN || code == SYS_HALT)
- wdt_set_time(0); /* Turn the WDT off */
-
- return NOTIFY_DONE;
-}
-
-/*
* Kernel Interfaces
*/
* turn the timebomb registers off.
*/
-static struct notifier_block wdt_notifier = {
- .notifier_call = wdt_notify_sys,
-};
-
static int wdt_find(int addr)
{
u8 val;
watchdog_init_timeout(&wdt_dev, timeout, NULL);
watchdog_set_nowayout(&wdt_dev, nowayout);
+ watchdog_stop_on_reboot(&wdt_dev);
ret = w83627hf_init(&wdt_dev, chip);
if (ret) {
return ret;
}
- ret = register_reboot_notifier(&wdt_notifier);
- if (ret != 0) {
- pr_err("cannot register reboot notifier (err=%d)\n", ret);
- return ret;
- }
-
ret = watchdog_register_device(&wdt_dev);
if (ret)
- goto unreg_reboot;
+ return ret;
pr_info("initialized. timeout=%d sec (nowayout=%d)\n",
wdt_dev.timeout, nowayout);
return ret;
-
-unreg_reboot:
- unregister_reboot_notifier(&wdt_notifier);
- return ret;
}
static void __exit wdt_exit(void)
{
watchdog_unregister_device(&wdt_dev);
- unregister_reboot_notifier(&wdt_notifier);
}
module_init(wdt_init);