static int ar7_wdt_open(struct inode *inode, struct file *file) { /* only allow one at a time */ if (test_and_set_bit(0, &wdt_is_open)) return -EBUSY; ar7_wdt_enable_wdt(); expect_close = 0; return nonseekable_open(inode, file); }
static int ar7_wdt_open(struct inode *inode, struct file *file) { /* only allow one at a time */ if (down_trylock(&open_semaphore)) return -EBUSY; ar7_wdt_enable_wdt(); expect_close = 0; return nonseekable_open(inode, file); }