serial: imx: get rid of imx_uart_rts_auto()
authorSergey Organov <sorganov@gmail.com>
Fri, 26 Jul 2019 18:52:41 +0000 (21:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:46 +0000 (12:43 +0200)
Called in only one place, for RS232, it only obscures things, as it
doesn't go well with 2 similar named functions,
imx_uart_rts_inactive() and imx_uart_rts_active(), that both are
RS485-specific.

Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Link: https://lore.kernel.org/r/1564167161-3972-4-git-send-email-sorganov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 059ba35..d9a73c7 100644 (file)
@@ -402,17 +402,6 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2)
        mctrl_gpio_set(sport->gpios, sport->port.mctrl);
 }
 
-/* called with port.lock taken and irqs caller dependent */
-static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2)
-{
-       /*
-        * Only let receiver control RTS output if we were not requested to have
-        * RTS inactive (which then should take precedence).
-        */
-       if (*ucr2 & UCR2_CTS)
-               *ucr2 |= UCR2_CTSC;
-}
-
 /* called with port.lock taken and irqs off */
 static void imx_uart_start_rx(struct uart_port *port)
 {
@@ -1604,8 +1593,14 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
                else
                        imx_uart_rts_inactive(sport, &ucr2);
 
-       } else if (termios->c_cflag & CRTSCTS)
-               imx_uart_rts_auto(sport, &ucr2);
+       } else if (termios->c_cflag & CRTSCTS) {
+               /*
+                * Only let receiver control RTS output if we were not requested
+                * to have RTS inactive (which then should take precedence).
+                */
+               if (ucr2 & UCR2_CTS)
+                       ucr2 |= UCR2_CTSC;
+       }
 
        if (termios->c_cflag & CRTSCTS)
                ucr2 &= ~UCR2_IRTS;