aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/crisv10.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-12 13:44:32 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-12 13:44:32 -0500
commitf392ecfa12de9a2baf72789b00557bac040d6171 (patch)
treee406fbff12d8b7fa173a23f871d1b3b24473d144 /drivers/serial/crisv10.c
parent593195f9b2309693f27b402f34573f7920b82c3e (diff)
[SERIAL] turn serial semaphores into mutexes
Turn several drivers/serial/ semaphores-used-as-mutex into mutexes Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/crisv10.c')
-rw-r--r--drivers/serial/crisv10.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 08c42c000188..be12623d8544 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -442,6 +442,7 @@ static char *serial_version = "$Revision: 1.25 $";
442#include <linux/init.h> 442#include <linux/init.h>
443#include <asm/uaccess.h> 443#include <asm/uaccess.h>
444#include <linux/kernel.h> 444#include <linux/kernel.h>
445#include <linux/mutex.h>
445 446
446#include <asm/io.h> 447#include <asm/io.h>
447#include <asm/irq.h> 448#include <asm/irq.h>
@@ -1315,11 +1316,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =
1315 * memory if large numbers of serial ports are open. 1316 * memory if large numbers of serial ports are open.
1316 */ 1317 */
1317static unsigned char *tmp_buf; 1318static unsigned char *tmp_buf;
1318#ifdef DECLARE_MUTEX 1319static DEFINE_MUTEX(tmp_buf_mutex);
1319static DECLARE_MUTEX(tmp_buf_sem);
1320#else
1321static struct semaphore tmp_buf_sem = MUTEX;
1322#endif
1323 1320
1324/* Calculate the chartime depending on baudrate, numbor of bits etc. */ 1321/* Calculate the chartime depending on baudrate, numbor of bits etc. */
1325static void update_char_time(struct e100_serial * info) 1322static void update_char_time(struct e100_serial * info)
@@ -3661,7 +3658,7 @@ rs_raw_write(struct tty_struct * tty, int from_user,
3661 * design. 3658 * design.
3662 */ 3659 */
3663 if (from_user) { 3660 if (from_user) {
3664 down(&tmp_buf_sem); 3661 mutex_lock(&tmp_buf_mutex);
3665 while (1) { 3662 while (1) {
3666 int c1; 3663 int c1;
3667 c = CIRC_SPACE_TO_END(info->xmit.head, 3664 c = CIRC_SPACE_TO_END(info->xmit.head,
@@ -3692,7 +3689,7 @@ rs_raw_write(struct tty_struct * tty, int from_user,
3692 count -= c; 3689 count -= c;
3693 ret += c; 3690 ret += c;
3694 } 3691 }
3695 up(&tmp_buf_sem); 3692 mutex_unlock(&tmp_buf_mutex);
3696 } else { 3693 } else {
3697 cli(); 3694 cli();
3698 while (count) { 3695 while (count) {