Commit 6cb263df authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] 2.6.0-rc1 amd7xx_tco.module_param.patch

Made nowayout a module_parameter
parent 792d0cea
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
...@@ -59,9 +60,18 @@ static struct semaphore open_sem; ...@@ -59,9 +60,18 @@ static struct semaphore open_sem;
static spinlock_t amdtco_lock; /* only for device access */ static spinlock_t amdtco_lock; /* only for device access */
static char expect_close; static char expect_close;
MODULE_PARM(timeout, "i"); module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "range is 0-38 seconds, default is 38"); MODULE_PARM_DESC(timeout, "range is 0-38 seconds, default is 38");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static inline u8 seconds_to_ticks(int seconds) static inline u8 seconds_to_ticks(int seconds)
{ {
/* the internal timer is stored as ticks which decrement /* the internal timer is stored as ticks which decrement
...@@ -243,7 +253,7 @@ static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len, ...@@ -243,7 +253,7 @@ static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len,
return -ESPIPE; return -ESPIPE;
if (len) { if (len) {
#ifndef CONFIG_WATCHDOG_NOWAYOUT if (!nowayout)
size_t i; size_t i;
char c; char c;
expect_close = 0; expect_close = 0;
...@@ -255,7 +265,7 @@ static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len, ...@@ -255,7 +265,7 @@ static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len,
if (c == 'V') if (c == 'V')
expect_close = 42; expect_close = 42;
} }
#endif }
amdtco_ping(); amdtco_ping();
} }
......
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