diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-09-06 07:24:35 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2006-10-02 17:07:18 -0400 |
commit | 25ff3780d4cd46804e22192a728cfb6b33c84d1b (patch) | |
tree | e7c1c2c9d936ba973fd77a202ce2d7a71c277f02 /drivers/char | |
parent | 65a64ec3b4fc904932b832c53e5a86d56b972682 (diff) |
[WATCHDOG] s3c24XX nowayout
If the driver is not configured for `no way out`,
then the open method should not automatically allow
the setting of allow_close to CLOSE_STATE_ALLOW.
The setting of allow_close nullifies the use of
the magic close via the write path. It means that
in the default state, the watchdog will shut-down
even if the magic close has not been issued.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/watchdog/s3c2410_wdt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index be978e8ed75..a49f1f2ffa2 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -62,7 +62,7 @@ | |||
62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) | 62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) |
63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) | 63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) |
64 | 64 | ||
65 | static int nowayout = WATCHDOG_NOWAYOUT; | 65 | static int nowayout = WATCHDOG_NOWAYOUT; |
66 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; | 66 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; |
67 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; | 67 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; |
68 | static int soft_noboot = 0; | 68 | static int soft_noboot = 0; |
@@ -213,11 +213,10 @@ static int s3c2410wdt_open(struct inode *inode, struct file *file) | |||
213 | if(down_trylock(&open_lock)) | 213 | if(down_trylock(&open_lock)) |
214 | return -EBUSY; | 214 | return -EBUSY; |
215 | 215 | ||
216 | if (nowayout) { | 216 | if (nowayout) |
217 | __module_get(THIS_MODULE); | 217 | __module_get(THIS_MODULE); |
218 | } else { | 218 | |
219 | allow_close = CLOSE_STATE_ALLOW; | 219 | allow_close = CLOSE_STATE_NOT; |
220 | } | ||
221 | 220 | ||
222 | /* start the timer */ | 221 | /* start the timer */ |
223 | s3c2410wdt_start(); | 222 | s3c2410wdt_start(); |
@@ -230,6 +229,7 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file) | |||
230 | * Shut off the timer. | 229 | * Shut off the timer. |
231 | * Lock it in if it's a module and we set nowayout | 230 | * Lock it in if it's a module and we set nowayout |
232 | */ | 231 | */ |
232 | |||
233 | if (allow_close == CLOSE_STATE_ALLOW) { | 233 | if (allow_close == CLOSE_STATE_ALLOW) { |
234 | s3c2410wdt_stop(); | 234 | s3c2410wdt_stop(); |
235 | } else { | 235 | } else { |