]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
USB: serial: ftdi_sio: fix 300 bps rate for SIO
authorJohan Hovold <johan@kernel.org>
Tue, 13 Sep 2022 14:53:12 +0000 (16:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:15:34 +0000 (13:15 +0200)
commit 7bd7ad3c310cd6766f170927381eea0aa6f46c69 upstream.

The 300 bps rate of SIO devices has been mapped to 9600 bps since
2003... Let's fix the regression.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ftdi_sio.c

index eceb6f27fec8b9ad9f7f2d2a42583ef1aa603d79..7b854f4e25f5a1f9f074df557d8181ae2535ff89 100644 (file)
@@ -1340,8 +1340,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
                case 38400: div_value = ftdi_sio_b38400; break;
                case 57600: div_value = ftdi_sio_b57600;  break;
                case 115200: div_value = ftdi_sio_b115200; break;
-               } /* baud */
-               if (div_value == 0) {
+               default:
                        dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n",
                                __func__,  baud);
                        div_value = ftdi_sio_b9600;