USB: serial: console: add support for flow control
authorJohan Hovold <johan@kernel.org>
Wed, 1 Jul 2020 17:37:22 +0000 (19:37 +0200)
committerJohan Hovold <johan@kernel.org>
Thu, 2 Jul 2020 08:38:45 +0000 (10:38 +0200)
Add support for enabling hardware flow control using the 'r' command
line option.

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

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/console.c

index 7d28930..b97aa40 100644 (file)
@@ -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