summaryrefslogtreecommitdiff
path: root/drivers/tty/mxser.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-11-18 10:31:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-25 20:33:21 +0300
commit5c338fbf21ebf2206a4d5abf3bc077c9a9018a79 (patch)
tree88934e5799087b48b4794f59744d1d368e2fcd0e /drivers/tty/mxser.c
parent3b88dbff1c4e7d8a78e11773f19869c598552fcb (diff)
downloadlinux-5c338fbf21ebf2206a4d5abf3bc077c9a9018a79.tar.xz
mxser: remove pointless xmit_buf checks
xmit_buf is supposed to exist in all these functions. I.e. from tty_port_operations::activate() to ::shutdown(). So remove these checks. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20211118073125.12283-7-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.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index eb5fb4fb2aef..6e5e1c74bf3e 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -929,9 +929,6 @@ static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int cou
struct mxser_port *info = tty->driver_data;
unsigned long flags;
- if (!info->port.xmit_buf)
- return 0;
-
while (1) {
c = min_t(int, count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head));
@@ -962,9 +959,6 @@ static int mxser_put_char(struct tty_struct *tty, unsigned char ch)
struct mxser_port *info = tty->driver_data;
unsigned long flags;
- if (!info->port.xmit_buf)
- return 0;
-
if (info->xmit_cnt >= SERIAL_XMIT_SIZE - 1)
return 0;
@@ -982,7 +976,7 @@ static void mxser_flush_chars(struct tty_struct *tty)
{
struct mxser_port *info = tty->driver_data;
- if (!info->xmit_cnt || tty->flow.stopped || !info->port.xmit_buf ||
+ if (!info->xmit_cnt || tty->flow.stopped ||
(tty->hw_stopped && !mxser_16550A_or_MUST(info)))
return;
@@ -1397,7 +1391,7 @@ static void mxser_start(struct tty_struct *tty)
unsigned long flags;
spin_lock_irqsave(&info->slock, flags);
- if (info->xmit_cnt && info->port.xmit_buf)
+ if (info->xmit_cnt)
__mxser_start_tx(info);
spin_unlock_irqrestore(&info->slock, flags);
}
@@ -1631,9 +1625,6 @@ static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *port
return;
}
- if (port->port.xmit_buf == NULL)
- return;
-
if (!port->xmit_cnt || tty->flow.stopped ||
(tty->hw_stopped && !mxser_16550A_or_MUST(port))) {
__mxser_stop_tx(port);