summaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-28 23:00:51 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-28 23:00:51 +0300
commit7203062171db6669f746d14148c4af76af619e74 (patch)
tree5640e34ebe000769828632d3d6b9b95170283aab /drivers/usb/serial
parentdfdc1de64248b5e1024d8188aeaf0e59ec6cecd5 (diff)
parentb31c41339f4f8a833cb9dc509f87aab6a159ffe4 (diff)
downloadlinux-7203062171db6669f746d14148c4af76af619e74.tar.xz
Merge tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH: "Here are the big set of tty and serial driver changes for 5.18-rc1. Nothing major, some more good cleanups from Jiri and 2 new serial drivers. Highlights include: - termbits cleanups - export symbol cleanups and other core cleanups from Jiri Slaby - new sunplus and mvebu uart drivers (amazing that people are still creating new uarts...) - samsung serial driver cleanups - ldisc 29 is now "reserved" for experimental/development line disciplines - lots of other tiny fixes and cleanups to serial drivers and bindings All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (104 commits) vt_ioctl: fix potential spectre v1 in VT_DISALLOCATE serial: 8250: fix XOFF/XON sending when DMA is used tty: serial: samsung: Add ARTPEC-8 support dt-bindings: serial: samsung: Add ARTPEC-8 UART serial: sc16is7xx: Clear RS485 bits in the shutdown tty: serial: samsung: simplify getting OF match data tty: serial: samsung: constify variables and pointers tty: serial: samsung: constify s3c24xx_serial_drv_data members tty: serial: samsung: constify UART name tty: serial: samsung: constify s3c24xx_serial_drv_data tty: serial: samsung: reduce number of casts tty: serial: samsung: embed s3c2410_uartcfg in parent structure tty: serial: samsung: embed s3c24xx_uart_info in parent structure serial: 8250_tegra: mark acpi_device_id as unused with !ACPI tty: serial: bcm63xx: use more precise Kconfig symbol serial: SERIAL_SUNPLUS should depend on ARCH_SUNPLUS tty: serial: jsm: fix two assignments in if conditions tty: serial: jsm: remove redundant assignments to variable linestatus serial: 8250_mtk: make two read-only arrays static const serial: samsung_tty: do not unlock port->lock for uart_write_wakeup() ...
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ark3116.c17
-rw-r--r--drivers/usb/serial/f81232.c16
-rw-r--r--drivers/usb/serial/f81534.c16
-rw-r--r--drivers/usb/serial/mos7720.c20
-rw-r--r--drivers/usb/serial/quatech2.c16
-rw-r--r--drivers/usb/serial/ssu100.c16
6 files changed, 7 insertions, 94 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 5dd710e9fe7d..c0e4df87ff22 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -200,21 +200,8 @@ static void ark3116_set_termios(struct tty_struct *tty,
__u8 lcr, hcr, eval;
/* set data bit count */
- switch (cflag & CSIZE) {
- case CS5:
- lcr = UART_LCR_WLEN5;
- break;
- case CS6:
- lcr = UART_LCR_WLEN6;
- break;
- case CS7:
- lcr = UART_LCR_WLEN7;
- break;
- default:
- case CS8:
- lcr = UART_LCR_WLEN8;
- break;
- }
+ lcr = UART_LCR_WLEN(tty_get_char_size(cflag));
+
if (cflag & CSTOPB)
lcr |= UART_LCR_STOP;
if (cflag & PARENB)
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 3ad1f515fb68..d9f20256a6a8 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -643,21 +643,7 @@ static void f81232_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));
mutex_lock(&priv->lock);
diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
index c0bca52ef92a..d789c1ec87b3 100644
--- a/drivers/usb/serial/f81534.c
+++ b/drivers/usb/serial/f81534.c
@@ -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)
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 227f43d2bd56..1e12b5f30dcc 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1380,30 +1380,12 @@ static void change_port_settings(struct tty_struct *tty,
return;
}
- lData = UART_LCR_WLEN8;
lStop = 0x00; /* 1 stop bit */
lParity = 0x00; /* No parity */
cflag = tty->termios.c_cflag;
- /* Change the number of bits */
- switch (cflag & CSIZE) {
- case CS5:
- lData = UART_LCR_WLEN5;
- break;
-
- case CS6:
- lData = UART_LCR_WLEN6;
- break;
-
- case CS7:
- lData = UART_LCR_WLEN7;
- break;
- default:
- case CS8:
- lData = UART_LCR_WLEN8;
- break;
- }
+ lData = UART_LCR_WLEN(tty_get_char_size(cflag));
/* Change the Parity bit */
if (cflag & PARENB) {
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index 971907f083a3..36b1e064e51f 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -281,21 +281,7 @@ static void qt2_set_termios(struct tty_struct *tty,
new_lcr |= SERIAL_EVEN_PARITY;
}
- switch (cflag & CSIZE) {
- 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(cflag));
baud = tty_get_baud_rate(tty);
if (!baud)
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)