diff options
author | Jiri Slaby <jslaby@suse.cz> | 2022-02-24 10:55:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 21:49:06 +0100 |
commit | 5e1440bc23324846a003052787af6aa492e90773 (patch) | |
tree | 5229fec9026a2cf76a832348280de1df0515bc73 /drivers/usb/serial/ssu100.c | |
parent | tty: serial: make use of UART_LCR_WLEN() + tty_get_char_size() (diff) | |
download | linux-5e1440bc23324846a003052787af6aa492e90773.tar.xz linux-5e1440bc23324846a003052787af6aa492e90773.zip |
USB: serial: make use of UART_LCR_WLEN() + tty_get_char_size()
Having a generic UART_LCR_WLEN() macro and the tty_get_char_size()
helper, we can remove all those repeated switch-cases in drivers.
Cc: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220224095558.30929-3-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ssu100.c')
-rw-r--r-- | drivers/usb/serial/ssu100.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 3baf7c0f5a98..181e302136a5 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -231,21 +231,7 @@ static void ssu100_set_termios(struct tty_struct *tty, urb_value |= SERIAL_EVEN_PARITY; } - switch (cflag & CSIZE) { - case CS5: - urb_value |= UART_LCR_WLEN5; - break; - case CS6: - urb_value |= UART_LCR_WLEN6; - break; - case CS7: - urb_value |= UART_LCR_WLEN7; - break; - default: - case CS8: - urb_value |= UART_LCR_WLEN8; - break; - } + urb_value |= UART_LCR_WLEN(tty_get_char_size(cflag)); baud = tty_get_baud_rate(tty); if (!baud) |