提交 02f00c4a 编写于 作者: F Frank Schäfer 提交者: Greg Kroah-Hartman

USB: serial: pl2303: fix the upper baud rate limit check for type_0/1 chips

Fixes the following regression that has been introduced recently with
commit b2d6d98f:
With type_0 and type_1 chips
- all baud rates < 1228800 baud are rounded up to 1228800 baud
- the device silently runs at 9600 baud for all baud rates > 1228800
  baud
Signed-off-by: NFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 78283dd2
......@@ -303,7 +303,7 @@ static void pl2303_encode_baudrate(struct tty_struct *tty,
/* type_0, type_1 only support up to 1228800 baud */
if (spriv->type != HX)
baud = max_t(int, baud, 1228800);
baud = min_t(int, baud, 1228800);
if (baud <= 115200) {
put_unaligned_le32(baud, buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册