aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:16:39 -0400
committerJonathan Corbet <corbet@lwn.net>2008-07-02 17:06:24 -0400
commit41012735352e72b8a3f95521817dcad1b2986636 (patch)
tree32508a6e49a2abc2a932511e0e2a88066c44dd18
parent4333deee6b7a5a82afb9e700e76cb46e68fde68d (diff)
rtc-rtc-m41t80: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/rtc/rtc-m41t80.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index a3e0880b38fb..0a19c06019be 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp_lock.h>
20#include <linux/string.h> 21#include <linux/string.h>
21#include <linux/i2c.h> 22#include <linux/i2c.h>
22#include <linux/rtc.h> 23#include <linux/rtc.h>
@@ -655,12 +656,16 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
655static int wdt_open(struct inode *inode, struct file *file) 656static int wdt_open(struct inode *inode, struct file *file)
656{ 657{
657 if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { 658 if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) {
658 if (test_and_set_bit(0, &wdt_is_open)) 659 lock_kernel();
660 if (test_and_set_bit(0, &wdt_is_open)) {
661 unlock_kernel();
659 return -EBUSY; 662 return -EBUSY;
663 }
660 /* 664 /*
661 * Activate 665 * Activate
662 */ 666 */
663 wdt_is_open = 1; 667 wdt_is_open = 1;
668 unlock_kernel();
664 return 0; 669 return 0;
665 } 670 }
666 return -ENODEV; 671 return -ENODEV;