aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/snsc.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-10-30 04:43:08 -0400
committerIngo Molnar <mingo@elte.hu>2010-10-30 04:43:08 -0400
commit169ed55bd30305b933f52bfab32a58671d44ab68 (patch)
tree32e280957474f458901abfce16fa2a1687ef7497 /drivers/char/snsc.c
parent3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff)
parent45f81b1c96d9793e47ce925d257ea693ce0b193e (diff)
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'drivers/char/snsc.c')
-rw-r--r--drivers/char/snsc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 32b74de18f5f..5816b39ff5a9 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -21,7 +21,7 @@
21#include <linux/poll.h> 21#include <linux/poll.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/smp_lock.h> 24#include <linux/mutex.h>
25#include <asm/sn/io.h> 25#include <asm/sn/io.h>
26#include <asm/sn/sn_sal.h> 26#include <asm/sn/sn_sal.h>
27#include <asm/sn/module.h> 27#include <asm/sn/module.h>
@@ -34,6 +34,7 @@
34#define SCDRV_BUFSZ 2048 34#define SCDRV_BUFSZ 2048
35#define SCDRV_TIMEOUT 1000 35#define SCDRV_TIMEOUT 1000
36 36
37static DEFINE_MUTEX(scdrv_mutex);
37static irqreturn_t 38static irqreturn_t
38scdrv_interrupt(int irq, void *subch_data) 39scdrv_interrupt(int irq, void *subch_data)
39{ 40{
@@ -105,7 +106,7 @@ scdrv_open(struct inode *inode, struct file *file)
105 file->private_data = sd; 106 file->private_data = sd;
106 107
107 /* hook this subchannel up to the system controller interrupt */ 108 /* hook this subchannel up to the system controller interrupt */
108 lock_kernel(); 109 mutex_lock(&scdrv_mutex);
109 rv = request_irq(SGI_UART_VECTOR, scdrv_interrupt, 110 rv = request_irq(SGI_UART_VECTOR, scdrv_interrupt,
110 IRQF_SHARED | IRQF_DISABLED, 111 IRQF_SHARED | IRQF_DISABLED,
111 SYSCTL_BASENAME, sd); 112 SYSCTL_BASENAME, sd);
@@ -113,10 +114,10 @@ scdrv_open(struct inode *inode, struct file *file)
113 ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch); 114 ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch);
114 kfree(sd); 115 kfree(sd);
115 printk("%s: irq request failed (%d)\n", __func__, rv); 116 printk("%s: irq request failed (%d)\n", __func__, rv);
116 unlock_kernel(); 117 mutex_unlock(&scdrv_mutex);
117 return -EBUSY; 118 return -EBUSY;
118 } 119 }
119 unlock_kernel(); 120 mutex_unlock(&scdrv_mutex);
120 return 0; 121 return 0;
121} 122}
122 123
@@ -357,6 +358,7 @@ static const struct file_operations scdrv_fops = {
357 .poll = scdrv_poll, 358 .poll = scdrv_poll,
358 .open = scdrv_open, 359 .open = scdrv_open,
359 .release = scdrv_release, 360 .release = scdrv_release,
361 .llseek = noop_llseek,
360}; 362};
361 363
362static struct class *snsc_class; 364static struct class *snsc_class;