Commit b26a274f authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: ftdi_sio: fix initial baud rate

commit 108e02b1 upstream.

Fix regression introduced by commit b1ffb4c8 ("USB: Fix Corruption
issue in USB ftdi driver ftdi_sio.c") which caused the termios settings
to no longer be initialised at open. Consequently it was no longer
possible to set the port to the default speed of 9600 baud without first
changing to another baud rate and back again.
Reported-by: default avatarRoland Ramthun <mail@roland-ramthun.de>
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Tested-by: default avatarRoland Ramthun <mail@roland-ramthun.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3393e255
......@@ -1823,6 +1823,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct ktermios dummy;
struct usb_device *dev = port->serial->dev;
struct ftdi_private *priv = usb_get_serial_port_data(port);
int result;
......@@ -1841,8 +1842,10 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
This is same behaviour as serial.c/rs_open() - Kuba */
/* ftdi_set_termios will send usb control messages */
if (tty)
ftdi_set_termios(tty, port, tty->termios);
if (tty) {
memset(&dummy, 0, sizeof(dummy));
ftdi_set_termios(tty, port, &dummy);
}
/* Start reading from the device */
result = usb_serial_generic_open(tty, port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment