]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
serial: imx: set_termios(): factor-out 'ucr2' initial value
authorSergey Organov <sorganov@gmail.com>
Wed, 26 Jun 2019 14:11:28 +0000 (17:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 17:35:41 +0000 (19:35 +0200)
Set common bits in a separate statement to make initialization
explicit and not repeat the common part.

Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Reviewed-by: Uwe Kleine-Knig <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/1561558293-7683-3-git-send-email-sorganov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 52374b37d272abdc03e734ed80dcd336ac143059..df2186cac615198d372090a49cf91812adbc7b4a 100644 (file)
@@ -1562,10 +1562,9 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
 
        spin_lock_irqsave(&sport->port.lock, flags);
 
+       ucr2 = UCR2_SRST | UCR2_IRTS;
        if ((termios->c_cflag & CSIZE) == CS8)
-               ucr2 = UCR2_WS | UCR2_SRST | UCR2_IRTS;
-       else
-               ucr2 = UCR2_SRST | UCR2_IRTS;
+               ucr2 |= UCR2_WS;
 
        if (termios->c_cflag & CRTSCTS) {
                if (sport->have_rtscts) {