| From 51a2897e38814dc21408888a8d3ddd364e7686e2 Mon Sep 17 00:00:00 2001 |
| From: Paul Gortmaker <paul.gortmaker@windriver.com> |
| Date: Thu, 8 Mar 2012 19:12:14 -0500 |
| Subject: serial: remove back and forth conversions in serial_out_sync |
| |
| The two callers to serial_out_sync() have a struct port right |
| there in scope, but then pass in a struct 8250_port which then |
| is locally resolved back to a struct port. |
| |
| Delete the needless back and forth and just pass in the struct |
| port directly. Rename the function to have "_port" in its |
| name, so the name <--> args relationship is consistent with the |
| other serial_in/out vs serial_port_in/out function classes. |
| |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| Acked-by: Alan Cox <alan@linux.intel.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| (cherry picked from commit 55e4016dd055e262e4b078b81c80b55386ead0f4) |
| |
| Signed-off-by: Simon Horman <horms@verge.net.au> |
| --- |
| drivers/tty/serial/8250/8250.c | 7 +++---- |
| 1 file changed, 3 insertions(+), 4 deletions(-) |
| |
| diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c |
| index cb45a29..56492d2 100644 |
| --- a/drivers/tty/serial/8250/8250.c |
| +++ b/drivers/tty/serial/8250/8250.c |
| @@ -467,9 +467,8 @@ static void set_io_from_upio(struct uart_port *p) |
| } |
| |
| static void |
| -serial_out_sync(struct uart_8250_port *up, int offset, int value) |
| +serial_port_out_sync(struct uart_port *p, int offset, int value) |
| { |
| - struct uart_port *p = &up->port; |
| switch (p->iotype) { |
| case UPIO_MEM: |
| case UPIO_MEM32: |
| @@ -2022,11 +2021,11 @@ static int serial8250_startup(struct uart_port *port) |
| disable_irq_nosync(port->irq); |
| |
| wait_for_xmitr(up, UART_LSR_THRE); |
| - serial_out_sync(up, UART_IER, UART_IER_THRI); |
| + serial_port_out_sync(port, UART_IER, UART_IER_THRI); |
| udelay(1); /* allow THRE to set */ |
| iir1 = serial_port_in(port, UART_IIR); |
| serial_port_out(port, UART_IER, 0); |
| - serial_out_sync(up, UART_IER, UART_IER_THRI); |
| + serial_port_out_sync(port, UART_IER, UART_IER_THRI); |
| udelay(1); /* allow a working UART time to re-assert THRE */ |
| iir = serial_port_in(port, UART_IIR); |
| serial_port_out(port, UART_IER, 0); |
| -- |
| 1.7.10.1.362.g242cab3 |
| |