mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 10:04:12 +08:00
serial: 8250_dwlib: remove redundant sanity check for RS485 flags
Before the drivers rs485_config() function is called the serial core already ensures that only one of both options RTS on send or RTS after send is set. So remove the concerning sanity check in the driver function to avoid redundancy. Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Link: https://lore.kernel.org/r/20220710164442.2958979-8-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
885dcb08c9
commit
c64e17584b
@ -187,16 +187,10 @@ static int dw8250_rs485_config(struct uart_port *p, struct ktermios *termios,
|
|||||||
if (rs485->flags & SER_RS485_ENABLED) {
|
if (rs485->flags & SER_RS485_ENABLED) {
|
||||||
tcr |= DW_UART_TCR_RS485_EN;
|
tcr |= DW_UART_TCR_RS485_EN;
|
||||||
|
|
||||||
if (rs485->flags & SER_RS485_RX_DURING_TX) {
|
if (rs485->flags & SER_RS485_RX_DURING_TX)
|
||||||
tcr |= DW_UART_TCR_XFER_MODE_DE_DURING_RE;
|
tcr |= DW_UART_TCR_XFER_MODE_DE_DURING_RE;
|
||||||
} else {
|
else
|
||||||
/* HW does not support same DE level for tx and rx */
|
|
||||||
if (!(rs485->flags & SER_RS485_RTS_ON_SEND) ==
|
|
||||||
!(rs485->flags & SER_RS485_RTS_AFTER_SEND))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
tcr |= DW_UART_TCR_XFER_MODE_DE_OR_RE;
|
tcr |= DW_UART_TCR_XFER_MODE_DE_OR_RE;
|
||||||
}
|
|
||||||
dw8250_writel_ext(p, DW_UART_DE_EN, 1);
|
dw8250_writel_ext(p, DW_UART_DE_EN, 1);
|
||||||
dw8250_writel_ext(p, DW_UART_RE_EN, 1);
|
dw8250_writel_ext(p, DW_UART_RE_EN, 1);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user