[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220703170039.2058202-8-LinoSanfilippo@gmx.de>
Date: Sun, 3 Jul 2022 19:00:37 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: gregkh@...uxfoundation.org, jirislaby@...nel.org
Cc: ilpo.jarvinen@...ux.intel.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org,
andriy.shevchenko@...ux.intel.com, vz@...ia.com,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
lukas@...ner.de, p.rosenberger@...bus.com,
Lino Sanfilippo <l.sanfilippo@...bus.com>
Subject: [PATCH v2 7/9] serial: ar933x: Fix check for RS485 support
From: Lino Sanfilippo <l.sanfilippo@...bus.com>
Without an RTS GPIO RS485 is not possible so disable the support
regardless of whether RS485 is enabled at boottime or not. Also remove the
now superfluous check for the RTS GPIO in ar933x_config_rs485().
Fixes: e849145e1fdd ("serial: ar933x: Fill in rs485_supported")
Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
---
drivers/tty/serial/ar933x_uart.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index b73ce13683db..dac48a330db6 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -583,14 +583,6 @@ static const struct uart_ops ar933x_uart_ops = {
static int ar933x_config_rs485(struct uart_port *port, struct ktermios *termios,
struct serial_rs485 *rs485conf)
{
- struct ar933x_uart_port *up =
- container_of(port, struct ar933x_uart_port, port);
-
- if ((rs485conf->flags & SER_RS485_ENABLED) &&
- !up->rts_gpiod) {
- dev_err(port->dev, "RS485 needs rts-gpio\n");
- return 1;
- }
port->rs485 = *rs485conf;
return 0;
}
@@ -798,11 +790,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
--
2.25.1
Powered by blists - more mailing lists