Commit 6a4667e8 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[WATCHDOG] SC520 nowayout fixes from 2.4

parent 15e13a00
...@@ -110,6 +110,15 @@ static unsigned long next_heartbeat; ...@@ -110,6 +110,15 @@ static unsigned long next_heartbeat;
static unsigned long wdt_is_open; static unsigned long wdt_is_open;
static int wdt_expect_close; static int wdt_expect_close;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static spinlock_t wdt_spinlock; static spinlock_t wdt_spinlock;
/* /*
* Whack the dog * Whack the dog
...@@ -172,12 +181,12 @@ static void wdt_startup(void) ...@@ -172,12 +181,12 @@ static void wdt_startup(void)
static void wdt_turnoff(void) static void wdt_turnoff(void)
{ {
#ifndef CONFIG_WATCHDOG_NOWAYOUT if (!nowayout) {
/* Stop the timer */ /* Stop the timer */
del_timer(&timer); del_timer(&timer);
wdt_config(0); wdt_config(0);
printk(OUR_NAME ": Watchdog timer is now disabled...\n"); printk(OUR_NAME ": Watchdog timer is now disabled...\n");
#endif }
} }
...@@ -226,9 +235,9 @@ static int fop_open(struct inode * inode, struct file * file) ...@@ -226,9 +235,9 @@ static int fop_open(struct inode * inode, struct file * file)
return -EBUSY; return -EBUSY;
/* Good, fire up the show */ /* Good, fire up the show */
wdt_startup(); wdt_startup();
#ifdef CONFIG_WATCHDOG_NOWAYOUT if (nowayout)
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
#endif
return 0; return 0;
default: default:
return -ENODEV; return -ENODEV;
...@@ -260,9 +269,9 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -260,9 +269,9 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{ {
static struct watchdog_info ident= static struct watchdog_info ident=
{ {
0, .options = WDIOF_MAGICCLOSE,
1, .firmware_version = 1,
"SC520" .identity = "SC520"
}; };
switch(cmd) switch(cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment