diff options
author | Arnd Bergmann <arnd@arndb.de> | 2008-05-20 19:16:39 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-02 15:06:24 -0600 |
commit | 41012735352e72b8a3f95521817dcad1b2986636 (patch) | |
tree | 32508a6e49a2abc2a932511e0e2a88066c44dd18 /drivers/rtc | |
parent | 4333deee6b7a5a82afb9e700e76cb46e68fde68d (diff) |
rtc-rtc-m41t80: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index a3e0880b38f..0a19c06019b 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/slab.h> +#include <linux/smp_lock.h> #include <linux/string.h> #include <linux/i2c.h> #include <linux/rtc.h> @@ -655,12 +656,16 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int wdt_open(struct inode *inode, struct file *file) { if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { - if (test_and_set_bit(0, &wdt_is_open)) + lock_kernel(); + if (test_and_set_bit(0, &wdt_is_open)) { + unlock_kernel(); return -EBUSY; + } /* * Activate */ wdt_is_open = 1; + unlock_kernel(); return 0; } return -ENODEV; |