diff options
Diffstat (limited to 'arch/cris/arch-v10/drivers/sync_serial.c')
-rw-r--r-- | arch/cris/arch-v10/drivers/sync_serial.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index ee2dd4323daf..3d9fa074a941 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/poll.h> | 21 | #include <linux/poll.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/smp_lock.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/dma.h> | 26 | #include <asm/dma.h> |
@@ -149,6 +149,7 @@ struct sync_port { | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | 151 | ||
152 | static DEFINE_MUTEX(sync_serial_mutex); | ||
152 | static int etrax_sync_serial_init(void); | 153 | static int etrax_sync_serial_init(void); |
153 | static void initialize_port(int portnbr); | 154 | static void initialize_port(int portnbr); |
154 | static inline int sync_data_avail(struct sync_port *port); | 155 | static inline int sync_data_avail(struct sync_port *port); |
@@ -445,7 +446,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
445 | int mode; | 446 | int mode; |
446 | int err = -EBUSY; | 447 | int err = -EBUSY; |
447 | 448 | ||
448 | lock_kernel(); | 449 | mutex_lock(&sync_serial_mutex); |
449 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); | 450 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); |
450 | 451 | ||
451 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { | 452 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { |
@@ -626,7 +627,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
626 | ret = 0; | 627 | ret = 0; |
627 | 628 | ||
628 | out: | 629 | out: |
629 | unlock_kernel(); | 630 | mutex_unlock(&sync_serial_mutex); |
630 | return ret; | 631 | return ret; |
631 | } | 632 | } |
632 | 633 | ||
@@ -961,9 +962,9 @@ static long sync_serial_ioctl(struct file *file, | |||
961 | { | 962 | { |
962 | long ret; | 963 | long ret; |
963 | 964 | ||
964 | lock_kernel(); | 965 | mutex_lock(&sync_serial_mutex); |
965 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); | 966 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); |
966 | unlock_kernel(); | 967 | mutex_unlock(&sync_serial_mutex); |
967 | 968 | ||
968 | return ret; | 969 | return ret; |
969 | } | 970 | } |