diff options
Diffstat (limited to 'arch/cris/arch-v32/drivers/sync_serial.c')
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 11 |
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 | ||
148 | static DEFINE_MUTEX(sync_serial_mutex); | ||
148 | static int etrax_sync_serial_init(void); | 149 | static int etrax_sync_serial_init(void); |
149 | static void initialize_port(int portnbr); | 150 | static void initialize_port(int portnbr); |
150 | static inline int sync_data_avail(struct sync_port *port); | 151 | static 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; |
585 | out: | 586 | out: |
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 | } |