From f392ecfa12de9a2baf72789b00557bac040d6171 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 12 Jan 2006 18:44:32 +0000 Subject: [SERIAL] turn serial semaphores into mutexes Turn several drivers/serial/ semaphores-used-as-mutex into mutexes Signed-off-by: Arjan van de Ven Signed-off-by: Russell King --- drivers/serial/crisv10.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/serial/crisv10.c') diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 08c42c00018..be12623d854 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c @@ -442,6 +442,7 @@ static char *serial_version = "$Revision: 1.25 $"; #include #include #include +#include #include #include @@ -1315,11 +1316,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] = * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -#ifdef DECLARE_MUTEX -static DECLARE_MUTEX(tmp_buf_sem); -#else -static struct semaphore tmp_buf_sem = MUTEX; -#endif +static DEFINE_MUTEX(tmp_buf_mutex); /* Calculate the chartime depending on baudrate, numbor of bits etc. */ static void update_char_time(struct e100_serial * info) @@ -3661,7 +3658,7 @@ rs_raw_write(struct tty_struct * tty, int from_user, * design. */ if (from_user) { - down(&tmp_buf_sem); + mutex_lock(&tmp_buf_mutex); while (1) { int c1; c = CIRC_SPACE_TO_END(info->xmit.head, @@ -3692,7 +3689,7 @@ rs_raw_write(struct tty_struct * tty, int from_user, count -= c; ret += c; } - up(&tmp_buf_sem); + mutex_unlock(&tmp_buf_mutex); } else { cli(); while (count) { -- cgit v1.2.3-70-g09d2