diff options
author | Sergey Organov <sorganov@gmail.com> | 2019-07-26 14:52:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-04 06:43:46 -0400 |
commit | b777b5de6aaa98df37c0fe1f7a33fa1c63d0e326 (patch) | |
tree | 1541df9ff8cc72626c4b2cce19254d76db106b99 | |
parent | 197540dc8301a296e8ae7aa062f9f61f047eea05 (diff) |
serial: imx: get rid of imx_uart_rts_auto()
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>
-rw-r--r-- | drivers/tty/serial/imx.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 059ba354d17e..d9a73c7683ea 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -402,17 +402,6 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2) | |||
402 | mctrl_gpio_set(sport->gpios, sport->port.mctrl); | 402 | mctrl_gpio_set(sport->gpios, sport->port.mctrl); |
403 | } | 403 | } |
404 | 404 | ||
405 | /* called with port.lock taken and irqs caller dependent */ | ||
406 | static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2) | ||
407 | { | ||
408 | /* | ||
409 | * Only let receiver control RTS output if we were not requested to have | ||
410 | * RTS inactive (which then should take precedence). | ||
411 | */ | ||
412 | if (*ucr2 & UCR2_CTS) | ||
413 | *ucr2 |= UCR2_CTSC; | ||
414 | } | ||
415 | |||
416 | /* called with port.lock taken and irqs off */ | 405 | /* called with port.lock taken and irqs off */ |
417 | static void imx_uart_start_rx(struct uart_port *port) | 406 | static void imx_uart_start_rx(struct uart_port *port) |
418 | { | 407 | { |
@@ -1604,8 +1593,14 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1604 | else | 1593 | else |
1605 | imx_uart_rts_inactive(sport, &ucr2); | 1594 | imx_uart_rts_inactive(sport, &ucr2); |
1606 | 1595 | ||
1607 | } else if (termios->c_cflag & CRTSCTS) | 1596 | } else if (termios->c_cflag & CRTSCTS) { |
1608 | imx_uart_rts_auto(sport, &ucr2); | 1597 | /* |
1598 | * Only let receiver control RTS output if we were not requested | ||
1599 | * to have RTS inactive (which then should take precedence). | ||
1600 | */ | ||
1601 | if (ucr2 & UCR2_CTS) | ||
1602 | ucr2 |= UCR2_CTSC; | ||
1603 | } | ||
1609 | 1604 | ||
1610 | if (termios->c_cflag & CRTSCTS) | 1605 | if (termios->c_cflag & CRTSCTS) |
1611 | ucr2 &= ~UCR2_IRTS; | 1606 | ucr2 &= ~UCR2_IRTS; |