Merge tag 'pci-v5.18-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / usb / serial / f81534.c
index c0bca52ef92aa905b5302779e416b6cb235d4504..d789c1ec87b353cf4b9a6d3c46dbf5f9478a0dc3 100644 (file)
@@ -970,21 +970,7 @@ static void f81534_set_termios(struct tty_struct *tty,
        if (C_CSTOPB(tty))
                new_lcr |= UART_LCR_STOP;
 
-       switch (C_CSIZE(tty)) {
-       case CS5:
-               new_lcr |= UART_LCR_WLEN5;
-               break;
-       case CS6:
-               new_lcr |= UART_LCR_WLEN6;
-               break;
-       case CS7:
-               new_lcr |= UART_LCR_WLEN7;
-               break;
-       default:
-       case CS8:
-               new_lcr |= UART_LCR_WLEN8;
-               break;
-       }
+       new_lcr |= UART_LCR_WLEN(tty_get_char_size(tty->termios.c_cflag));
 
        baud = tty_get_baud_rate(tty);
        if (!baud)