diff options
author | Lino Sanfilippo <l.sanfilippo@kunbus.com> | 2022-07-10 18:44:35 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-14 16:34:23 +0200 |
commit | 996fd3cf9c0f37d17867ccc26f8b746169463fcd (patch) | |
tree | 6a28475c8b495d09e465d1c81d291a5b1f5bb808 /drivers/tty/serial/ar933x_uart.c | |
parent | serial: 8250_bcm7271: Save/restore RTS in suspend/resume (diff) | |
download | linux-996fd3cf9c0f37d17867ccc26f8b746169463fcd.tar.xz linux-996fd3cf9c0f37d17867ccc26f8b746169463fcd.zip |
serial: ar933x: Fix check for RS485 support
RS485 is not possible without an RTS GPIO regardless of whether RS485 is
enabled at boot time or not. So correct the concerning check in the probe()
function.
Fixes: e849145e1fdd ("serial: ar933x: Fill in rs485_supported")
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20220710164442.2958979-2-LinoSanfilippo@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/ar933x_uart.c')
-rw-r--r-- | drivers/tty/serial/ar933x_uart.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index f931ecbc0bc0..f7b4638d69e5 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -798,11 +798,12 @@ static int ar933x_uart_probe(struct platform_device *pdev) up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS); - if ((port->rs485.flags & SER_RS485_ENABLED) && - !up->rts_gpiod) { - dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); - port->rs485.flags &= ~SER_RS485_ENABLED; + if (!up->rts_gpiod) { port->rs485_supported = ar933x_no_rs485; + if (port->rs485.flags & SER_RS485_ENABLED) { + dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); + port->rs485.flags &= ~SER_RS485_ENABLED; + } } #ifdef CONFIG_SERIAL_AR933X_CONSOLE |