aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r--drivers/usb/serial/console.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 9a4cd0a932b3..7b74238ad1c7 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -81,39 +81,11 @@ static int usb_console_setup(struct console *co, char *options)
81 if (*s) 81 if (*s)
82 doflow = (*s++ == 'r'); 82 doflow = (*s++ == 'r');
83 } 83 }
84
85 /* Sane default */
86 if (baud == 0)
87 baud = 9600;
84 88
85 /* build a cflag setting */
86 switch (baud) {
87 case 1200:
88 cflag |= B1200;
89 break;
90 case 2400:
91 cflag |= B2400;
92 break;
93 case 4800:
94 cflag |= B4800;
95 break;
96 case 19200:
97 cflag |= B19200;
98 break;
99 case 38400:
100 cflag |= B38400;
101 break;
102 case 57600:
103 cflag |= B57600;
104 break;
105 case 115200:
106 cflag |= B115200;
107 break;
108 case 9600:
109 default:
110 cflag |= B9600;
111 /*
112 * Set this to a sane value to prevent a divide error
113 */
114 baud = 9600;
115 break;
116 }
117 switch (bits) { 89 switch (bits) {
118 case 7: 90 case 7:
119 cflag |= CS7; 91 cflag |= CS7;
@@ -188,6 +160,7 @@ static int usb_console_setup(struct console *co, char *options)
188 160
189 if (serial->type->set_termios) { 161 if (serial->type->set_termios) {
190 termios->c_cflag = cflag; 162 termios->c_cflag = cflag;
163 tty_termios_encode_baud_rate(termios, baud, baud);
191 serial->type->set_termios(NULL, port, &dummy); 164 serial->type->set_termios(NULL, port, &dummy);
192 165
193 port->port.tty = NULL; 166 port->port.tty = NULL;