diff mbox series

[2,4/9] serial: sc16is7xx: remove redundant check in rs485_config

Message ID 20220216001803.637-5-LinoSanfilippo@gmx.de
State Superseded
Headers show
Series [2,1/9] serial: core: move RS485 configuration tasks from drivers into core | expand

Commit Message

Lino Sanfilippo Feb. 16, 2022, 12:17 a.m. UTC
In uart_set_rs485_config() the serial core already ensures that only one of
both options RTS on send or RTS after send is set.

So remove this check from the drivers rs485_config() function to avoid
redundancy.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
 drivers/tty/serial/sc16is7xx.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Lino Sanfilippo Feb. 17, 2022, 10:11 p.m. UTC | #1
Hi,

On 17.02.22 at 12:47, Lukas Wunner wrote:
> On Wed, Feb 16, 2022 at 01:17:58AM +0100, Lino Sanfilippo wrote:
>> --- a/drivers/tty/serial/sc16is7xx.c
>> +++ b/drivers/tty/serial/sc16is7xx.c
>> @@ -959,16 +959,6 @@ static int sc16is7xx_config_rs485(struct uart_port *port,
>>  	struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
>>
>>  	if (rs485->flags & SER_RS485_ENABLED) {
>> -		bool rts_during_rx, rts_during_tx;
>> -
>> -		rts_during_rx = rs485->flags & SER_RS485_RTS_AFTER_SEND;
>> -		rts_during_tx = rs485->flags & SER_RS485_RTS_ON_SEND;
>> -
>> -		if (rts_during_rx == rts_during_tx)
>> -			dev_err(port->dev,
>> -				"unsupported RTS signalling on_send:%d after_send:%d - exactly one of RS485 RTS flags should be set\n",
>> -				rts_during_tx, rts_during_rx);
>> -
>
> Hm, patch 1 in this series doesn't emit such a message, so unlike now,
> users will no longer be warned that they passed in nonsensical settings...
>

what about logging a warning for both RTS polarity and delay correction?

Regards,
Lino
diff mbox series

Patch

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 64e7e6c8145f..730f697bb517 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -959,16 +959,6 @@  static int sc16is7xx_config_rs485(struct uart_port *port,
 	struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
 
 	if (rs485->flags & SER_RS485_ENABLED) {
-		bool rts_during_rx, rts_during_tx;
-
-		rts_during_rx = rs485->flags & SER_RS485_RTS_AFTER_SEND;
-		rts_during_tx = rs485->flags & SER_RS485_RTS_ON_SEND;
-
-		if (rts_during_rx == rts_during_tx)
-			dev_err(port->dev,
-				"unsupported RTS signalling on_send:%d after_send:%d - exactly one of RS485 RTS flags should be set\n",
-				rts_during_tx, rts_during_rx);
-
 		/*
 		 * RTS signal is handled by HW, it's timing can't be influenced.
 		 * However, it's sometimes useful to delay TX even without RTS