提交 25ff3780 编写于 作者: B Ben Dooks 提交者: Wim Van Sebroeck

[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: NBen Dooks <ben-linux@fluff.org>
上级 65a64ec3
...@@ -213,11 +213,10 @@ static int s3c2410wdt_open(struct inode *inode, struct file *file) ...@@ -213,11 +213,10 @@ static int s3c2410wdt_open(struct inode *inode, struct file *file)
if(down_trylock(&open_lock)) if(down_trylock(&open_lock))
return -EBUSY; return -EBUSY;
if (nowayout) { if (nowayout)
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
} else {
allow_close = CLOSE_STATE_ALLOW; allow_close = CLOSE_STATE_NOT;
}
/* start the timer */ /* start the timer */
s3c2410wdt_start(); s3c2410wdt_start();
...@@ -230,6 +229,7 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file) ...@@ -230,6 +229,7 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file)
* Shut off the timer. * Shut off the timer.
* Lock it in if it's a module and we set nowayout * Lock it in if it's a module and we set nowayout
*/ */
if (allow_close == CLOSE_STATE_ALLOW) { if (allow_close == CLOSE_STATE_ALLOW) {
s3c2410wdt_stop(); s3c2410wdt_stop();
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册