diff options
author | Andrew Worsley <amworsley@gmail.com> | 2011-11-22 04:00:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-26 22:58:47 -0500 |
commit | c515598e0f5769916c31c00392cc2bfe6af74e55 (patch) | |
tree | 0ad96e7c288d9f953c537e1959d76ff70fbddae0 | |
parent | 045ddc8991698a8e9c5668c6190faa8b5d516dc0 (diff) |
USB: serial: ftdi_sio: Handle the old_termios == 0 case e.g. uart_resume_port()
Handle null old_termios in ftdi_set_termios() calls from uart_resume_port().
Signed-off-by: Andrew Worsley <amworsley@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index bd4298bb6750..13e4ecc6e43d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2104,6 +2104,9 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2104 | 2104 | ||
2105 | cflag = termios->c_cflag; | 2105 | cflag = termios->c_cflag; |
2106 | 2106 | ||
2107 | if (old_termios == 0) | ||
2108 | goto no_skip; | ||
2109 | |||
2107 | if (old_termios->c_cflag == termios->c_cflag | 2110 | if (old_termios->c_cflag == termios->c_cflag |
2108 | && old_termios->c_ispeed == termios->c_ispeed | 2111 | && old_termios->c_ispeed == termios->c_ispeed |
2109 | && old_termios->c_ospeed == termios->c_ospeed) | 2112 | && old_termios->c_ospeed == termios->c_ospeed) |
@@ -2117,6 +2120,7 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2117 | (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) | 2120 | (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) |
2118 | goto no_data_parity_stop_changes; | 2121 | goto no_data_parity_stop_changes; |
2119 | 2122 | ||
2123 | no_skip: | ||
2120 | /* Set number of data bits, parity, stop bits */ | 2124 | /* Set number of data bits, parity, stop bits */ |
2121 | 2125 | ||
2122 | urb_value = 0; | 2126 | urb_value = 0; |