]> err.no Git - linux-2.6/commitdiff
ip27-rtc: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:16:03 +0000 (19:16 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:57 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/char/ip27-rtc.c

index 86e6538a77b05835b352001d170dba5335be284b..ec9d0443d92c7a3f77b67832d064111119dfdead 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/bcd.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/ioport.h>
@@ -163,15 +164,18 @@ static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
 static int rtc_open(struct inode *inode, struct file *file)
 {
+       lock_kernel();
        spin_lock_irq(&rtc_lock);
 
        if (rtc_status & RTC_IS_OPEN) {
                spin_unlock_irq(&rtc_lock);
+               unlock_kernel();
                return -EBUSY;
        }
 
        rtc_status |= RTC_IS_OPEN;
        spin_unlock_irq(&rtc_lock);
+       unlock_kernel();
 
        return 0;
 }