aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2011-12-04 18:42:19 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-09 22:14:12 -0500
commit0690f41fddd285c3473e4af2a42d15bce7ff3e68 (patch)
tree2df38f436c0d05bce5183f53468aa523b1ece913 /drivers/tty
parent850624c15da4651f4c6b821723419d8777659577 (diff)
serial: clean up parameter passing for 8250 Rx IRQ handling
The receive_chars() was taking a pointer to a passed in LSR value in status and knocking off bits as it processed them. But since receive_chars isn't returning a value, we can instead pass in a normal non-pointer value for LSR, and simply return the residual (unprocessed) LSR once it is done. The value in this cleanup, is that it clarifies the API of the receive_chars prior to exporting it to other 8250-like drivers for shared usage. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index c58e9e286bf..5274228fa03 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1375,11 +1375,16 @@ static void clear_rx_fifo(struct uart_8250_port *up)
1375 } while (1); 1375 } while (1);
1376} 1376}
1377 1377
1378static void 1378/*
1379receive_chars(struct uart_8250_port *up, unsigned int *status) 1379 * receive_chars: processes according to the passed in LSR
1380 * value, and returns the remaining LSR bits not handled
1381 * by this Rx routine.
1382 */
1383static unsigned char
1384receive_chars(struct uart_8250_port *up, unsigned char lsr)
1380{ 1385{
1381 struct tty_struct *tty = up->port.state->port.tty; 1386 struct tty_struct *tty = up->port.state->port.tty;
1382 unsigned char ch, lsr = *status; 1387 unsigned char ch;
1383 int max_count = 256; 1388 int max_count = 256;
1384 char flag; 1389 char flag;
1385 1390
@@ -1455,7 +1460,7 @@ ignore_char:
1455 spin_unlock(&up->port.lock); 1460 spin_unlock(&up->port.lock);
1456 tty_flip_buffer_push(tty); 1461 tty_flip_buffer_push(tty);
1457 spin_lock(&up->port.lock); 1462 spin_lock(&up->port.lock);
1458 *status = lsr; 1463 return lsr;
1459} 1464}
1460 1465
1461static void transmit_chars(struct uart_8250_port *up) 1466static void transmit_chars(struct uart_8250_port *up)
@@ -1524,7 +1529,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
1524 */ 1529 */
1525static void serial8250_handle_port(struct uart_8250_port *up) 1530static void serial8250_handle_port(struct uart_8250_port *up)
1526{ 1531{
1527 unsigned int status; 1532 unsigned char status;
1528 unsigned long flags; 1533 unsigned long flags;
1529 1534
1530 spin_lock_irqsave(&up->port.lock, flags); 1535 spin_lock_irqsave(&up->port.lock, flags);
@@ -1534,7 +1539,7 @@ static void serial8250_handle_port(struct uart_8250_port *up)
1534 DEBUG_INTR("status = %x...", status); 1539 DEBUG_INTR("status = %x...", status);
1535 1540
1536 if (status & (UART_LSR_DR | UART_LSR_BI)) 1541 if (status & (UART_LSR_DR | UART_LSR_BI))
1537 receive_chars(up, &status); 1542 status = receive_chars(up, status);
1538 check_modem_status(up); 1543 check_modem_status(up);
1539 if (status & UART_LSR_THRE) 1544 if (status & UART_LSR_THRE)
1540 transmit_chars(up); 1545 transmit_chars(up);