aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_txx9.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/serial_txx9.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/serial_txx9.c')
-rw-r--r--drivers/serial/serial_txx9.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index fdd1f1915a42..ee98a867bc6d 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -52,6 +52,7 @@
52#include <linux/tty_flip.h> 52#include <linux/tty_flip.h>
53#include <linux/serial_core.h> 53#include <linux/serial_core.h>
54#include <linux/serial.h> 54#include <linux/serial.h>
55#include <linux/mutex.h>
55 56
56#include <asm/io.h> 57#include <asm/io.h>
57#include <asm/irq.h> 58#include <asm/irq.h>
@@ -1018,7 +1019,7 @@ static void serial_txx9_resume_port(int line)
1018 uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); 1019 uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port);
1019} 1020}
1020 1021
1021static DECLARE_MUTEX(serial_txx9_sem); 1022static DEFINE_MUTEX(serial_txx9_mutex);
1022 1023
1023/** 1024/**
1024 * serial_txx9_register_port - register a serial port 1025 * serial_txx9_register_port - register a serial port
@@ -1037,7 +1038,7 @@ static int __devinit serial_txx9_register_port(struct uart_port *port)
1037 struct uart_txx9_port *uart; 1038 struct uart_txx9_port *uart;
1038 int ret = -ENOSPC; 1039 int ret = -ENOSPC;
1039 1040
1040 down(&serial_txx9_sem); 1041 mutex_lock(&serial_txx9_mutex);
1041 for (i = 0; i < UART_NR; i++) { 1042 for (i = 0; i < UART_NR; i++) {
1042 uart = &serial_txx9_ports[i]; 1043 uart = &serial_txx9_ports[i];
1043 if (uart->port.type == PORT_UNKNOWN) 1044 if (uart->port.type == PORT_UNKNOWN)
@@ -1058,7 +1059,7 @@ static int __devinit serial_txx9_register_port(struct uart_port *port)
1058 if (ret == 0) 1059 if (ret == 0)
1059 ret = uart->port.line; 1060 ret = uart->port.line;
1060 } 1061 }
1061 up(&serial_txx9_sem); 1062 mutex_unlock(&serial_txx9_mutex);
1062 return ret; 1063 return ret;
1063} 1064}
1064 1065
@@ -1073,7 +1074,7 @@ static void __devexit serial_txx9_unregister_port(int line)
1073{ 1074{
1074 struct uart_txx9_port *uart = &serial_txx9_ports[line]; 1075 struct uart_txx9_port *uart = &serial_txx9_ports[line];
1075 1076
1076 down(&serial_txx9_sem); 1077 mutex_lock(&serial_txx9_mutex);
1077 uart_remove_one_port(&serial_txx9_reg, &uart->port); 1078 uart_remove_one_port(&serial_txx9_reg, &uart->port);
1078 uart->port.flags = 0; 1079 uart->port.flags = 0;
1079 uart->port.type = PORT_UNKNOWN; 1080 uart->port.type = PORT_UNKNOWN;
@@ -1082,7 +1083,7 @@ static void __devexit serial_txx9_unregister_port(int line)
1082 uart->port.membase = 0; 1083 uart->port.membase = 0;
1083 uart->port.dev = NULL; 1084 uart->port.dev = NULL;
1084 uart_add_one_port(&serial_txx9_reg, &uart->port); 1085 uart_add_one_port(&serial_txx9_reg, &uart->port);
1085 up(&serial_txx9_sem); 1086 mutex_unlock(&serial_txx9_mutex);
1086} 1087}
1087 1088
1088/* 1089/*