summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorJakub Kicinski <kubakici@wp.pl>2015-05-29 21:20:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 06:47:27 +0900
commit4ae82e5d23961515796d76850499db3866c5e73b (patch)
tree5f76e406512b415579cf83baad55828c553b7515 /drivers/tty/serial
parent4117a60c8e4c8d5f9fc05578e359d09d0fdf9d07 (diff)
sc16is7xx: use LSR_TEMT_BIT in .tx_empty()
LSR_TEMT_BIT (LSR bit 6) provides us exactly the information we need to determine if transmission is finished - FIFO level and shift register empty. We can save ourselves reading FIFO level explicitly if we use this bit. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sc16is7xx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 0509be025399..ea61a297b463 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -683,12 +683,11 @@ static void sc16is7xx_start_tx(struct uart_port *port)
static unsigned int sc16is7xx_tx_empty(struct uart_port *port)
{
- unsigned int lvl, lsr;
+ unsigned int lsr;
- lvl = sc16is7xx_port_read(port, SC16IS7XX_TXLVL_REG);
lsr = sc16is7xx_port_read(port, SC16IS7XX_LSR_REG);
- return ((lsr & SC16IS7XX_LSR_THRE_BIT) && !lvl) ? TIOCSER_TEMT : 0;
+ return (lsr & SC16IS7XX_LSR_TEMT_BIT) ? TIOCSER_TEMT : 0;
}
static unsigned int sc16is7xx_get_mctrl(struct uart_port *port)