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

index 235703414370b8aac9329e783319dc92f49b7546..23abfdfb44f1c113b2ddd86cc0c0bd9e747e60cc 100644 (file)
@@ -279,6 +279,7 @@ static inline int wd_opt_timeout(void)
 
 static int wd_open(struct inode *inode, struct file *f)
 {
+       lock_kernel();
        switch(iminor(inode))
        {
                case WD0_MINOR:
@@ -291,6 +292,7 @@ static int wd_open(struct inode *inode, struct file *f)
                        f->private_data = &wd_dev.watchdog[WD2_ID];
                        break;
                default:
+                       unlock_kernel();
                        return(-ENODEV);
        }
 
@@ -304,11 +306,13 @@ static int wd_open(struct inode *inode, struct file *f)
                                                (void *)wd_dev.regs)) {
                        printk("%s: Cannot register IRQ %d\n", 
                                WD_OBPNAME, wd_dev.irq);
+                       unlock_kernel();
                        return(-EBUSY);
                }
                wd_dev.initialized = 1;
        }
 
+       unlock_kernel();
        return(nonseekable_open(inode, f));
 }