ds1286: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:15:49 +0000 (19:15 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:56 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/char/ds1286.c

index ea35ab2c9909490bb490bb51eae47d39c31661b3..fb584938c9c3b2eb81bb954a8a8af41fa40fbf00 100644 (file)
@@ -27,6 +27,7 @@
  * option) any later version.
  */
 #include <linux/ds1286.h>
+#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
@@ -252,6 +253,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
 
 static int ds1286_open(struct inode *inode, struct file *file)
 {
+       lock_kernel();
        spin_lock_irq(&ds1286_lock);
 
        if (ds1286_status & RTC_IS_OPEN)
@@ -260,10 +262,12 @@ static int ds1286_open(struct inode *inode, struct file *file)
        ds1286_status |= RTC_IS_OPEN;
 
        spin_unlock_irq(&ds1286_lock);
+       unlock_kernel();
        return 0;
 
 out_busy:
        spin_lock_irq(&ds1286_lock);
+       unlock_kernel();
        return -EBUSY;
 }