USB: serial: xr: avoid requesting zero DTE rate

When the requested line speed is B0 (hangup) there is no need to use the
current speed in the line-coding request. This specifically avoids
requesting a zero DTE rate when the current speed is B0, which could
potentially confuse buggy firmware.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
Johan Hovold 2022-11-29 15:18:57 +01:00
parent d03a6d4e2b
commit 63b8ed26cd
1 changed files with 0 additions and 2 deletions

View File

@ -749,8 +749,6 @@ static void xr_cdc_set_line_coding(struct tty_struct *tty,
if (tty->termios.c_ospeed) if (tty->termios.c_ospeed)
lc->dwDTERate = cpu_to_le32(tty->termios.c_ospeed); lc->dwDTERate = cpu_to_le32(tty->termios.c_ospeed);
else if (old_termios)
lc->dwDTERate = cpu_to_le32(old_termios->c_ospeed);
else else
lc->dwDTERate = cpu_to_le32(9600); lc->dwDTERate = cpu_to_le32(9600);