X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fserial%2Fserial_txx9.c;h=ee98a867bc6dabd5604763fb7c0c26518bdb57bf;hb=f3e39e67b9b6ad6a51d13be902e8341f13b93531;hp=f10c86d60b647fb8dedad8423d7f507920d3b705;hpb=d7f6884ae0ae6e406ec3500fcde16e8f51642460;p=powerpc.git diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index f10c86d60b..ee98a867bc 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -303,17 +304,6 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status, struct pt_regs *r char flag; do { - /* The following is not allowed by the tty layer and - unsafe. It should be fixed ASAP */ - if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - if (tty->low_latency) { - spin_unlock(&up->port.lock); - tty_flip_buffer_push(tty); - spin_lock(&up->port.lock); - } - /* If this failed then we will throw away the - bytes but must do so to clear interrupts */ - } ch = sio_in(up, TXX9_SIRFIFO); flag = TTY_NORMAL; up->port.icount.rx++; @@ -1029,7 +1019,7 @@ static void serial_txx9_resume_port(int line) uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); } -static DECLARE_MUTEX(serial_txx9_sem); +static DEFINE_MUTEX(serial_txx9_mutex); /** * serial_txx9_register_port - register a serial port @@ -1048,7 +1038,7 @@ static int __devinit serial_txx9_register_port(struct uart_port *port) struct uart_txx9_port *uart; int ret = -ENOSPC; - down(&serial_txx9_sem); + mutex_lock(&serial_txx9_mutex); for (i = 0; i < UART_NR; i++) { uart = &serial_txx9_ports[i]; if (uart->port.type == PORT_UNKNOWN) @@ -1069,7 +1059,7 @@ static int __devinit serial_txx9_register_port(struct uart_port *port) if (ret == 0) ret = uart->port.line; } - up(&serial_txx9_sem); + mutex_unlock(&serial_txx9_mutex); return ret; } @@ -1084,7 +1074,7 @@ static void __devexit serial_txx9_unregister_port(int line) { struct uart_txx9_port *uart = &serial_txx9_ports[line]; - down(&serial_txx9_sem); + mutex_lock(&serial_txx9_mutex); uart_remove_one_port(&serial_txx9_reg, &uart->port); uart->port.flags = 0; uart->port.type = PORT_UNKNOWN; @@ -1093,7 +1083,7 @@ static void __devexit serial_txx9_unregister_port(int line) uart->port.membase = 0; uart->port.dev = NULL; uart_add_one_port(&serial_txx9_reg, &uart->port); - up(&serial_txx9_sem); + mutex_unlock(&serial_txx9_mutex); } /* @@ -1195,7 +1185,7 @@ static int __init serial_txx9_init(void) serial_txx9_register_ports(&serial_txx9_reg); #ifdef ENABLE_SERIAL_TXX9_PCI - ret = pci_module_init(&serial_txx9_pci_driver); + ret = pci_register_driver(&serial_txx9_pci_driver); #endif } return ret;