aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2012-02-06 04:24:44 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-09 12:02:25 -0500
commit30c6c6b5bf82d4f4a23235a0aa0657681d1c21f2 (patch)
tree40fa6b489078907ee9e9168984d68fe990b9aa8a /drivers/tty
parentd011411ddb294e90511211a9edfc79da1c0465dc (diff)
serial: pch_uart: trivial cleanup by removing the get_msr()
The short get_msr() has some unnecessary code and only used once, so merge it with its caller to make code cleaner. No functional change at all. Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/pch_uart.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 6d9ca2933361..811edcbe7304 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -373,14 +373,6 @@ static void pch_uart_hal_request(struct pci_dev *pdev, int fifosize,
373 priv->fcr = 0; 373 priv->fcr = 0;
374} 374}
375 375
376static unsigned int get_msr(struct eg20t_port *priv, void __iomem *base)
377{
378 unsigned int msr = ioread8(base + UART_MSR);
379 priv->dmsr |= msr & PCH_UART_MSR_DELTA;
380
381 return msr;
382}
383
384static void pch_uart_hal_enable_interrupt(struct eg20t_port *priv, 376static void pch_uart_hal_enable_interrupt(struct eg20t_port *priv,
385 unsigned int flag) 377 unsigned int flag)
386{ 378{
@@ -514,8 +506,9 @@ static int pch_uart_hal_set_fifo(struct eg20t_port *priv,
514 506
515static u8 pch_uart_hal_get_modem(struct eg20t_port *priv) 507static u8 pch_uart_hal_get_modem(struct eg20t_port *priv)
516{ 508{
517 priv->dmsr = 0; 509 unsigned int msr = ioread8(priv->membase + UART_MSR);
518 return get_msr(priv, priv->membase); 510 priv->dmsr = msr & PCH_UART_MSR_DELTA;
511 return (u8)msr;
519} 512}
520 513
521static void pch_uart_hal_write(struct eg20t_port *priv, 514static void pch_uart_hal_write(struct eg20t_port *priv,
@@ -596,7 +589,7 @@ static int push_rx(struct eg20t_port *priv, const unsigned char *buf,
596 589
597static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf) 590static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf)
598{ 591{
599 int ret; 592 int ret = 0;
600 struct uart_port *port = &priv->port; 593 struct uart_port *port = &priv->port;
601 594
602 if (port->x_char) { 595 if (port->x_char) {
@@ -605,8 +598,6 @@ static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf)
605 buf[0] = port->x_char; 598 buf[0] = port->x_char;
606 port->x_char = 0; 599 port->x_char = 0;
607 ret = 1; 600 ret = 1;
608 } else {
609 ret = 0;
610 } 601 }
611 602
612 return ret; 603 return ret;
@@ -1104,14 +1095,12 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id)
1104static unsigned int pch_uart_tx_empty(struct uart_port *port) 1095static unsigned int pch_uart_tx_empty(struct uart_port *port)
1105{ 1096{
1106 struct eg20t_port *priv; 1097 struct eg20t_port *priv;
1107 int ret; 1098
1108 priv = container_of(port, struct eg20t_port, port); 1099 priv = container_of(port, struct eg20t_port, port);
1109 if (priv->tx_empty) 1100 if (priv->tx_empty)
1110 ret = TIOCSER_TEMT; 1101 return TIOCSER_TEMT;
1111 else 1102 else
1112 ret = 0; 1103 return 0;
1113
1114 return ret;
1115} 1104}
1116 1105
1117/* Returns the current state of modem control inputs. */ 1106/* Returns the current state of modem control inputs. */
@@ -1345,9 +1334,8 @@ static void pch_uart_set_termios(struct uart_port *port,
1345 else 1334 else
1346 parity = PCH_UART_HAL_PARITY_EVEN; 1335 parity = PCH_UART_HAL_PARITY_EVEN;
1347 1336
1348 } else { 1337 } else
1349 parity = PCH_UART_HAL_PARITY_NONE; 1338 parity = PCH_UART_HAL_PARITY_NONE;
1350 }
1351 1339
1352 /* Only UART0 has auto hardware flow function */ 1340 /* Only UART0 has auto hardware flow function */
1353 if ((termios->c_cflag & CRTSCTS) && (priv->fifo_size == 256)) 1341 if ((termios->c_cflag & CRTSCTS) && (priv->fifo_size == 256))
@@ -1519,7 +1507,6 @@ static void
1519pch_console_write(struct console *co, const char *s, unsigned int count) 1507pch_console_write(struct console *co, const char *s, unsigned int count)
1520{ 1508{
1521 struct eg20t_port *priv; 1509 struct eg20t_port *priv;
1522
1523 unsigned long flags; 1510 unsigned long flags;
1524 u8 ier; 1511 u8 ier;
1525 int locked = 1; 1512 int locked = 1;