diff options
author | Lino Sanfilippo <l.sanfilippo@kunbus.com> | 2024-04-07 02:27:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-09 17:07:10 +0200 |
commit | fff4a5d5609db86ccdf1cf5791b7651b7f6a9b19 (patch) | |
tree | c86b6d53b42c5ea2c9e4ced569d992ca60adb91b /drivers/tty/serial/ar933x_uart.c | |
parent | serial: 8250: Remove superfluous sanity check (diff) | |
download | linux-fff4a5d5609db86ccdf1cf5791b7651b7f6a9b19.tar.xz linux-fff4a5d5609db86ccdf1cf5791b7651b7f6a9b19.zip |
serial: ar933x: Remove unneeded static structure
In case that no RTS GPIO is available do not use a dedicated nullified
serial_rs485 struct to disable RS485 support, but simply delete the
SER_RS485_ENABLED flag in the ports rs485_supported struct.
This make the structure superfluous and it can be removed.
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20240407002709.16224-5-l.sanfilippo@kunbus.com
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 | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index f2836ecc5c19..47889a557119 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -692,7 +692,6 @@ static struct uart_driver ar933x_uart_driver = { .cons = NULL, /* filled in runtime */ }; -static const struct serial_rs485 ar933x_no_rs485 = {}; static const struct serial_rs485 ar933x_rs485_supported = { .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND, }; @@ -788,7 +787,7 @@ static int ar933x_uart_probe(struct platform_device *pdev) up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS); if (!up->rts_gpiod) { - port->rs485_supported = ar933x_no_rs485; + port->rs485_supported.flags &= ~SER_RS485_ENABLED; if (port->rs485.flags & SER_RS485_ENABLED) { dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); port->rs485.flags &= ~SER_RS485_ENABLED; |