Skip to contentSkip to conversation

USB: serial: console: add support for enabling flow control

PATCH In review Johan Hovold 2 participants 3 messages Jul 1, 2020 – Jul 2, 2020

Subsystems (2)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: console: add support for enabling flow control

Add support for enabling hardware flow control using the 'r' command line option.

This also avoids a W=1 (-Wunused-but-set-variable) warning.

---

Missed this one at first... The white space change is done on purpose to remove a stray tab.

Johan

 drivers/usb/serial/console.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/serial/console.c +4 -1
index 7d289302ff6c..b97aa40ca4d1 100644
@@ -79,7 +79,7 @@ static int usb_console_setup(struct console *co, char *options)
 		if (*s)
 			doflow = (*s++ == 'r');
 	}
-	
+
 	/* Sane default */
 	if (baud == 0)
 		baud = 9600;
@@ -102,6 +102,9 @@ static int usb_console_setup(struct console *co, char *options)
 		break;
 	}
 
+	if (doflow)
+		cflag |= CRTSCTS;
+
 	/*
 	 * no need to check the index here: if the index is wrong, console
 	 * code won't call us
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 43 lines · Johan Hovold

Add support for enabling hardware flow control using the 'r' command line option.

This also avoids a W=1 (-Wunused-but-set-variable) warning.

---

Missed this one at first... The white space change is done on purpose to remove a stray tab.

Johan

 drivers/usb/serial/console.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/serial/console.c +4 -1
index 7d289302ff6c..b97aa40ca4d1 100644
@@ -79,7 +79,7 @@ static int usb_console_setup(struct console *co, char *options)
 		if (*s)
 			doflow = (*s++ == 'r');
 	}
-	
+
 	/* Sane default */
 	if (baud == 0)
 		baud = 9600;
@@ -102,6 +102,9 @@ static int usb_console_setup(struct console *co, char *options)
 		break;
 	}
 
+	if (doflow)
+		cflag |= CRTSCTS;
+
 	/*
 	 * no need to check the index here: if the index is wrong, console
 	 * code won't call us
Signature · 1 line
2.26.2

Nice fix!

And I think one of the first real "bugfixes" that have come out of the recent W=1 work...

author maintainer
#2 lore raw
Quoted 20 lines · Greg Kroah-Hartman
Quoted 19 lines · Johan Hovold

Add support for enabling hardware flow control using the 'r' command line option.

This also avoids a W=1 (-Wunused-but-set-variable) warning.

 drivers/usb/serial/console.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/serial/console.c +0 -0
index 7d289302ff6c..b97aa40ca4d1 100644
@@ -102,6 +102,9 @@ static int usb_console_setup(struct console *co, char *options)
 		break;
 	}
 
Quoted 11 lines
Quoted 9 lines
drivers/usb/serial/console.c +3 -0
+	if (doflow)
+		cflag |= CRTSCTS;
+
 	/*
 	 * no need to check the index here: if the index is wrong, console
 	 * code won't call us
Signature · 1 line
2.26.2

Nice fix!

Or is it a new feature? ;)

Quoted 2 lines

And I think one of the first real "bugfixes" that have come out of the recent W=1 work...

Yeah, first one I've seen too.

Quoted 1 line

Thanks for reviewing. All of these now applied.

Johan