projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
834119f
)
mxser: make use of UART_LCR_WLEN() + tty_get_char_size()
author
Jiri Slaby
<jslaby@suse.cz>
Thu, 24 Feb 2022 09:55:58 +0000
(10:55 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 28 Feb 2022 21:17:25 +0000
(22:17 +0100)
Having a generic UART_LCR_WLEN() macro and the tty_get_char_size()
helper, we can remove all those repeated switch-cases in drivers.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link:
https://lore.kernel.org/r/20220224095558.30929-5-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c
patch
|
blob
|
history
diff --git
a/drivers/tty/mxser.c
b/drivers/tty/mxser.c
index 836c9eca2946a09ee707274879be43a6bcd3f085..6ebd3e4ed8593c4d3d7e72167d752914a5770804 100644
(file)
--- a/
drivers/tty/mxser.c
+++ b/
drivers/tty/mxser.c
@@
-588,21
+588,7
@@
static void mxser_change_speed(struct tty_struct *tty, struct ktermios *old_term
}
/* byte size and parity */
- switch (cflag & CSIZE) {
- default:
- case CS5:
- cval = UART_LCR_WLEN5;
- break;
- case CS6:
- cval = UART_LCR_WLEN6;
- break;
- case CS7:
- cval = UART_LCR_WLEN7;
- break;
- case CS8:
- cval = UART_LCR_WLEN8;
- break;
- }
+ cval = UART_LCR_WLEN(tty_get_char_size(tty->termios.c_cflag));
if (cflag & CSTOPB)
cval |= UART_LCR_STOP;