summary refs log tree commit diff
path: root/drivers/tty/vcc.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-03-02 07:22:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-10 09:34:09 +0100
commit10eb63e5a9b243181f0e87033875f94f3698afda (patch)
tree1cbf86edec2d1de1fd54fcfcc72a5e5cc56b0425 /drivers/tty/vcc.c
parentab78b0c9fa9dfc02f823aac9f8174d4ee0585057 (diff)
downloadlinux-10eb63e5a9b243181f0e87033875f94f3698afda.tar.gz
tty: make everyone's chars_in_buffer return >= 0
The tty line disciplines don't expect tty_operations::chars_in_buffer to
return negative values. Fix the two drivers which violate this.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210302062214.29627-43-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vcc.c')
-rw-r--r--drivers/tty/vcc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 04a792749816..3106df98558a 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -896,7 +896,7 @@ static int vcc_chars_in_buffer(struct tty_struct *tty)
 	port = vcc_get_ne(tty->index);
 	if (unlikely(!port)) {
 		pr_err("VCC: chars_in_buffer: Failed to find VCC port\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	num = port->chars_in_buffer;