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/8250.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/serial/8250.c') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 54e5cc0dd5f8..fb610c3634a4 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -2467,7 +2468,7 @@ static struct platform_device *serial8250_isa_devs; * 16x50 serial ports to be configured at run-time, to support PCMCIA * modems and PCI multiport cards. */ -static DECLARE_MUTEX(serial_sem); +static DEFINE_MUTEX(serial_mutex); static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *port) { @@ -2522,7 +2523,7 @@ int serial8250_register_port(struct uart_port *port) if (port->uartclk == 0) return -EINVAL; - down(&serial_sem); + mutex_lock(&serial_mutex); uart = serial8250_find_match_or_unused(port); if (uart) { @@ -2544,7 +2545,7 @@ int serial8250_register_port(struct uart_port *port) if (ret == 0) ret = uart->port.line; } - up(&serial_sem); + mutex_unlock(&serial_mutex); return ret; } @@ -2561,7 +2562,7 @@ void serial8250_unregister_port(int line) { struct uart_8250_port *uart = &serial8250_ports[line]; - down(&serial_sem); + mutex_lock(&serial_mutex); uart_remove_one_port(&serial8250_reg, &uart->port); if (serial8250_isa_devs) { uart->port.flags &= ~UPF_BOOT_AUTOCONF; @@ -2571,7 +2572,7 @@ void serial8250_unregister_port(int line) } else { uart->port.dev = NULL; } - up(&serial_sem); + mutex_unlock(&serial_mutex); } EXPORT_SYMBOL(serial8250_unregister_port); -- cgit v1.2.2