USB-serial fixes for 5.6-rc2

Here's a fix for a ch341 regression in 5.5 which people have started to
 hit, and a fix for a logic error in an ir-usb error path.
 
 Both have been in linux-next with no reported issues.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQHbPq+cpGvN/peuzMLxc3C7H1lCAUCXkUsAQAKCRALxc3C7H1l
 CF+cAP9CPo+dy0rMGKPWkqGfLInimD6pMheJYe3gUZ4xgcbMkQEA+J3u3wYJQ7ND
 Ia/KRCMV+mvvQTv9skejnd5K94TsVQ8=
 =EY3I
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-5.6-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for 5.6-rc2

Here's a fix for a ch341 regression in 5.5 which people have started to
hit, and a fix for a logic error in an ir-usb error path.

Both have been in linux-next with no reported issues.

Signed-off-by: Johan Hovold <johan@kernel.org>

* tag 'usb-serial-5.6-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
  USB: serial: ch341: fix receiver regression
  USB: serial: ir-usb: Silence harmless uninitialized variable warning
This commit is contained in:
Greg Kroah-Hartman 2020-02-13 04:53:29 -08:00
commit d593126a96
2 changed files with 11 additions and 1 deletions

View File

@ -205,6 +205,16 @@ static int ch341_get_divisor(speed_t speed)
16 * speed - 16 * CH341_CLKRATE / (clk_div * (div + 1)))
div++;
/*
* Prefer lower base clock (fact = 0) if even divisor.
*
* Note that this makes the receiver more tolerant to errors.
*/
if (fact == 1 && div % 2 == 0) {
div /= 2;
fact = 0;
}
return (0x100 - div) << 8 | fact << 2 | ps;
}

View File

@ -448,7 +448,7 @@ static void ir_set_termios(struct tty_struct *tty,
usb_sndbulkpipe(udev, port->bulk_out_endpointAddress),
transfer_buffer, 1, &actual_length, 5000);
if (ret || actual_length != 1) {
if (actual_length != 1)
if (!ret)
ret = -EIO;
dev_err(&port->dev, "failed to change line speed: %d\n", ret);
}