static int bfin_wdt_release(struct inode *inode, struct file *file)
{
	stampit();

	if (expect_close == 42)
		bfin_wdt_stop();
	else {
		pr_crit("Unexpected close, not stopping watchdog!\n");
		bfin_wdt_keepalive();
	}
	expect_close = 0;
	clear_bit(0, &open_check);
	return 0;
}
Beispiel #2
0
static int bfin_wdt_open(struct inode *inode, struct file *file)
{
	stampit();

	if (test_and_set_bit(0, &open_check))
		return -EBUSY;

	if (nowayout)
		__module_get(THIS_MODULE);

	bfin_wdt_keepalive();
	bfin_wdt_start();

	return nonseekable_open(inode, file);
}