aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorJiri Slaby <[email protected]>2021-06-10 11:02:47 +0200
committerGreg Kroah-Hartman <[email protected]>2021-06-15 14:03:27 +0200
commit3ec2ff37230e1c961d4b0d0118dd23c46b5bcdbb (patch)
tree0af2a1a3482bf777f758835eee06a2bb2ea0d7ac /drivers/usb/class
parentd8f0209bfedb801d06a81a74b003a882dee3ea3f (diff)
tty: make use of tty_get_{char,frame}_size
In the previous patch, we introduced tty_get_char_size() and tty_get_frame_size() for computing character and frame sizes, respectively. Here, we make use of them in various tty drivers where applicable. The stats look nice: 12 insertions, 169 deletions. Cc: Arnd Bergmann <[email protected]> Cc: David Lin <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Alex Elder <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Andy Gross <[email protected]> Cc: Bjorn Andersson <[email protected]> Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Oliver Neukum <[email protected]> Acked-by: Alex Elder <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-acm.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 81199efe0312..c9954eb56e00 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1056,21 +1056,8 @@ static void acm_tty_set_termios(struct tty_struct *tty,
newline.bParityType = termios->c_cflag & PARENB ?
(termios->c_cflag & PARODD ? 1 : 2) +
(termios->c_cflag & CMSPAR ? 2 : 0) : 0;
- switch (termios->c_cflag & CSIZE) {
- case CS5:
- newline.bDataBits = 5;
- break;
- case CS6:
- newline.bDataBits = 6;
- break;
- case CS7:
- newline.bDataBits = 7;
- break;
- case CS8:
- default:
- newline.bDataBits = 8;
- break;
- }
+ newline.bDataBits = tty_get_char_size(termios->c_cflag);
+
/* FIXME: Needs to clear unsupported bits in the termios */
acm->clocal = ((termios->c_cflag & CLOCAL) != 0);