Commit db2cbb5c authored by Colin Leitner's avatar Colin Leitner Committed by Greg Kroah-Hartman

USB: pl2303: fixed handling of CS5 setting

commit a3132499 upstream.

This patch fixes the CS5 setting on the PL2303 USB-to-serial devices. CS5 has a
value of 0 and the CSIZE setting has been skipped altogether by the enclosing
if. Tested on 3.11.6 and the scope shows the correct output after the fix has
been applied.

Tagged to be added to stable, because it fixes a user visible driver bug and is
simple enough to backport easily.
Signed-off-by: default avatarColin Leitner <colin.leitner@gmail.com>
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e80f4c2
...@@ -290,24 +290,22 @@ static void pl2303_set_termios(struct tty_struct *tty, ...@@ -290,24 +290,22 @@ static void pl2303_set_termios(struct tty_struct *tty,
dbg("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x", i, dbg("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x", i,
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]); buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
if (cflag & CSIZE) { switch (cflag & CSIZE) {
switch (cflag & CSIZE) { case CS5:
case CS5: buf[6] = 5;
buf[6] = 5; break;
break; case CS6:
case CS6: buf[6] = 6;
buf[6] = 6; break;
break; case CS7:
case CS7: buf[6] = 7;
buf[6] = 7; break;
break; default:
default: case CS8:
case CS8: buf[6] = 8;
buf[6] = 8; break;
break;
}
dbg("%s - data bits = %d", __func__, buf[6]);
} }
dbg("%s - data bits = %d", __func__, buf[6]);
/* For reference buf[0]:buf[3] baud rate value */ /* For reference buf[0]:buf[3] baud rate value */
/* NOTE: Only the values defined in baud_sup are supported ! /* NOTE: Only the values defined in baud_sup are supported !
......
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