aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/drivers/sync_serial.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:43:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:43:11 -0400
commit5704e44d283e907623e3775c1262f206a2c48cf3 (patch)
tree0a981b24173e90854e7b7d812b35859e1e5f0174 /arch/cris/arch-v32/drivers/sync_serial.c
parent91151240ed8e97cc4457dae4094153c2744f1eb8 (diff)
parent6de5bd128d381ad88ac6d419a5e597048eb468cf (diff)
Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: BKL: introduce CONFIG_BKL. dabusb: remove the BKL sunrpc: remove the big kernel lock init/main.c: remove BKL notations blktrace: remove the big kernel lock rtmutex-tester: make it build without BKL dvb-core: kill the big kernel lock dvb/bt8xx: kill the big kernel lock tlclk: remove big kernel lock fix rawctl compat ioctls breakage on amd64 and itanic uml: kill big kernel lock parisc: remove big kernel lock cris: autoconvert trivial BKL users alpha: kill big kernel lock isapnp: BKL removal s390/block: kill the big kernel lock hpet: kill BKL, add compat_ioctl
Diffstat (limited to 'arch/cris/arch-v32/drivers/sync_serial.c')
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index ca248f3adb8..a01ae9f3b81 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -13,7 +13,7 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/major.h> 14#include <linux/major.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/smp_lock.h> 16#include <linux/mutex.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/poll.h> 18#include <linux/poll.h>
19#include <linux/init.h> 19#include <linux/init.h>
@@ -145,6 +145,7 @@ typedef struct sync_port
145 spinlock_t lock; 145 spinlock_t lock;
146} sync_port; 146} sync_port;
147 147
148static DEFINE_MUTEX(sync_serial_mutex);
148static int etrax_sync_serial_init(void); 149static int etrax_sync_serial_init(void);
149static void initialize_port(int portnbr); 150static void initialize_port(int portnbr);
150static inline int sync_data_avail(struct sync_port *port); 151static inline int sync_data_avail(struct sync_port *port);
@@ -434,7 +435,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
434 reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; 435 reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
435 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; 436 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
436 437
437 lock_kernel(); 438 mutex_lock(&sync_serial_mutex);
438 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); 439 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
439 440
440 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) 441 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
@@ -583,7 +584,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
583 port->busy++; 584 port->busy++;
584 ret = 0; 585 ret = 0;
585out: 586out:
586 unlock_kernel(); 587 mutex_unlock(&sync_serial_mutex);
587 return ret; 588 return ret;
588} 589}
589 590
@@ -966,9 +967,9 @@ static long sync_serial_ioctl(struct file *file,
966{ 967{
967 long ret; 968 long ret;
968 969
969 lock_kernel(); 970 mutex_lock(&sync_serial_mutex);
970 ret = sync_serial_ioctl_unlocked(file, cmd, arg); 971 ret = sync_serial_ioctl_unlocked(file, cmd, arg);
971 unlock_kernel(); 972 mutex_unlock(&sync_serial_mutex);
972 973
973 return ret; 974 return ret;
974} 975}