diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-09-22 09:59:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-05 14:08:08 +0200 |
commit | 7d5006d59da3595272ce524f0d8b507397d265ae (patch) | |
tree | affbc0f8f277641299e4b9c8a3af3a1474a3b804 /drivers/tty/mxser.c | |
parent | mxser: restore baud rate if its setting fails (diff) | |
download | linux-7d5006d59da3595272ce524f0d8b507397d265ae.tar.xz linux-7d5006d59da3595272ce524f0d8b507397d265ae.zip |
mxser: simplify condition in mxser_receive_chars_new
mxser_receive_chars_old() is used whenever MOXA_MUST_LSR_RERR is set in
status no matter the HW ID (the last 'if'). So there is no need for
another check of MOXA_MUST_LSR_RERR _with_ hwid == MOXA_MUST_MU860_HWID
(the third 'if'). Hence remove this subcase. That allows us to check
status on a single line with both UART_LSR_BRK_ERROR_BITS (from the
second 'if') and MOXA_MUST_LSR_RERR (the last 'if').
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210922075938.31390-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r-- | drivers/tty/mxser.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index b9cc41782ce1..f907de56e08b 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1550,11 +1550,7 @@ static bool mxser_receive_chars_new(struct tty_struct *tty, if (hwid == MOXA_OTHER_UART) return false; - if (status & UART_LSR_BRK_ERROR_BITS) - return false; - if (hwid == MOXA_MUST_MU860_HWID && (status & MOXA_MUST_LSR_RERR)) - return false; - if (status & MOXA_MUST_LSR_RERR) + if (status & (UART_LSR_BRK_ERROR_BITS | MOXA_MUST_LSR_RERR)) return false; gdl = inb(port->ioaddr + MOXA_MUST_GDL_REGISTER); |