From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jslaby@suse.cz>, Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org
Subject: [PATCH 4/5] sdio_uart: make use of UART_LCR_WLEN() + tty_get_char_size()
Date: Thu, 24 Feb 2022 10:55:57 +0100 [thread overview]
Message-ID: <20220224095558.30929-4-jslaby@suse.cz> (raw)
In-Reply-To: <20220224095558.30929-1-jslaby@suse.cz>
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>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
---
drivers/mmc/core/sdio_uart.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
index 04c0823e0359..e6eb5bd6e440 100644
--- a/drivers/mmc/core/sdio_uart.c
+++ b/drivers/mmc/core/sdio_uart.c
@@ -250,21 +250,7 @@ static void sdio_uart_change_speed(struct sdio_uart_port *port,
unsigned char cval, fcr = 0;
unsigned int baud, quot;
- switch (termios->c_cflag & CSIZE) {
- case CS5:
- cval = UART_LCR_WLEN5;
- break;
- case CS6:
- cval = UART_LCR_WLEN6;
- break;
- case CS7:
- cval = UART_LCR_WLEN7;
- break;
- default:
- case CS8:
- cval = UART_LCR_WLEN8;
- break;
- }
+ cval = UART_LCR_WLEN(tty_get_char_size(termios->c_cflag));
if (termios->c_cflag & CSTOPB)
cval |= UART_LCR_STOP;
--
2.35.1
next prev parent reply other threads:[~2022-02-24 9:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 9:55 [PATCH 0/5] UART_LCR_WLEN cleanups Jiri Slaby
2022-02-24 9:55 ` [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Jiri Slaby
2022-02-24 9:55 ` [PATCH 2/5] tty: serial: make use of UART_LCR_WLEN() + tty_get_char_size() Jiri Slaby
2022-02-24 16:38 ` Thierry Reding
2022-02-24 9:55 ` [PATCH 3/5] USB: " Jiri Slaby
2022-02-24 9:55 ` Jiri Slaby [this message]
2022-02-28 16:16 ` [PATCH 4/5] sdio_uart: " Ulf Hansson
2022-02-24 9:55 ` [PATCH 5/5] mxser: " Jiri Slaby
2022-02-24 10:10 ` [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Greg KH
2022-02-24 10:42 ` Jiri Slaby
2022-02-24 11:23 ` Greg KH
2022-02-25 9:40 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224095558.30929-4-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox