Commit 1413ed21 authored by Dave Jones's avatar Dave Jones

[PATCH] watchdog nowayout for sbc60xxwdt

Originally from Matt Domsch.
Adds a nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
From 2.4
parent 9621acda
...@@ -109,6 +109,15 @@ static unsigned long next_heartbeat; ...@@ -109,6 +109,15 @@ static unsigned long next_heartbeat;
static int wdt_is_open; static int 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)");
/* /*
* Whack the dog * Whack the dog
*/ */
...@@ -202,6 +211,9 @@ static int fop_open(struct inode * inode, struct file * file) ...@@ -202,6 +211,9 @@ static int fop_open(struct inode * inode, struct file * file)
/* Just in case we're already talking to someone... */ /* Just in case we're already talking to someone... */
if(wdt_is_open) if(wdt_is_open)
return -EBUSY; return -EBUSY;
if (nowayout) {
MOD_INC_USE_COUNT;
}
/* Good, fire up the show */ /* Good, fire up the show */
wdt_is_open = 1; wdt_is_open = 1;
wdt_startup(); wdt_startup();
...@@ -216,7 +228,7 @@ static int fop_close(struct inode * inode, struct file * file) ...@@ -216,7 +228,7 @@ static int fop_close(struct inode * inode, struct file * file)
{ {
if(minor(inode->i_rdev) == WATCHDOG_MINOR) if(minor(inode->i_rdev) == WATCHDOG_MINOR)
{ {
if(wdt_expect_close) if(wdt_expect_close && !nowayout)
wdt_turnoff(); wdt_turnoff();
else { else {
del_timer(&timer); del_timer(&timer);
......
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