]> err.no Git - linux-2.6/commitdiff
snsc: cdev lock_kernel() pushdown
authorJonathan Corbet <corbet@lwn.net>
Thu, 15 May 2008 22:44:14 +0000 (16:44 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:50 +0000 (14:05 -0600)
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/char/snsc.c

index 8fe099a410654ffb35c5e9c0a3e8c42c8acbcb59..0b799ac1b04957f501d4c50539f58e7ee28199cd 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <asm/sn/io.h>
 #include <asm/sn/sn_sal.h>
 #include <asm/sn/module.h>
@@ -104,6 +105,7 @@ scdrv_open(struct inode *inode, struct file *file)
        file->private_data = sd;
 
        /* hook this subchannel up to the system controller interrupt */
+       lock_kernel();
        rv = request_irq(SGI_UART_VECTOR, scdrv_interrupt,
                         IRQF_SHARED | IRQF_DISABLED,
                         SYSCTL_BASENAME, sd);
@@ -111,9 +113,10 @@ scdrv_open(struct inode *inode, struct file *file)
                ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch);
                kfree(sd);
                printk("%s: irq request failed (%d)\n", __func__, rv);
+               unlock_kernel();
                return -EBUSY;
        }
-
+       unlock_kernel();
        return 0;
 }