diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-06-18 09:14:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-18 14:10:01 +0300 |
commit | 2c21832b55dd6f2c5be48133997b6614c1e6327b (patch) | |
tree | a1dd6b2c79e5cfc8f67b9a2b79d6af1d631ad0a2 /drivers/tty | |
parent | d811b26ba3a78d45ccfc8e562323d9104d321c87 (diff) | |
download | linux-2c21832b55dd6f2c5be48133997b6614c1e6327b.tar.xz |
mxser: cleanup mxser_change_speed
* use UART macros instead of magic constants
* let the default case reuse already existing code (CS5 case)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-38-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/mxser.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index c4ee5cb6952e..2a8bbce790f3 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -657,24 +657,23 @@ static void mxser_change_speed(struct tty_struct *tty) /* byte size and parity */ switch (cflag & CSIZE) { + default: case CS5: - cval = 0x00; + cval = UART_LCR_WLEN5; break; case CS6: - cval = 0x01; + cval = UART_LCR_WLEN6; break; case CS7: - cval = 0x02; + cval = UART_LCR_WLEN7; break; case CS8: - cval = 0x03; + cval = UART_LCR_WLEN8; break; - default: - cval = 0x00; - break; /* too keep GCC shut... */ } + if (cflag & CSTOPB) - cval |= 0x04; + cval |= UART_LCR_STOP; if (cflag & PARENB) cval |= UART_LCR_PARITY; if (!(cflag & PARODD)) |