summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-03-02 07:22:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-10 09:34:09 +0100
commit6bfbfcfc58005ee12d37b56a5e722618ef6bee8f (patch)
treea9cbd9e585a4d35f4df4950968a1dd7082efc7c8 /drivers/tty
parent10eb63e5a9b243181f0e87033875f94f3698afda (diff)
downloadlinux-6bfbfcfc58005ee12d37b56a5e722618ef6bee8f.tar.bz2
tty: make everyone's write_room return >= 0
The tty line disciplines don't expect tty_operations::write_room to return negative values. Fix the five drivers which violate this. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210302062214.29627-44-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/ipwireless/tty.c4
-rw-r--r--drivers/tty/n_gsm.c2
-rw-r--r--drivers/tty/vcc.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index 1836746991b5..99bb2f149ff5 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -235,10 +235,10 @@ static int ipw_write_room(struct tty_struct *linux_tty)
/* FIXME: Exactly how is the tty object locked here .. */
if (!tty)
- return -ENODEV;
+ return 0;
if (!tty->port.count)
- return -EINVAL;
+ return 0;
room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
if (room < 0)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index da10e975829f..9e12f9cb1a98 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3048,7 +3048,7 @@ static int gsmtty_write_room(struct tty_struct *tty)
{
struct gsm_dlci *dlci = tty->driver_data;
if (dlci->state == DLCI_CLOSED)
- return -EINVAL;
+ return 0;
return TX_SIZE - kfifo_len(&dlci->fifo);
}
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 3106df98558a..0a3a71e14df4 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -878,7 +878,7 @@ static int vcc_write_room(struct tty_struct *tty)
port = vcc_get_ne(tty->index);
if (unlikely(!port)) {
pr_err("VCC: write_room: Failed to find VCC port\n");
- return -ENODEV;
+ return 0;
}
num = VCC_BUFF_LEN - port->chars_in_buffer;