lkml.org 
[lkml]   [2022]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 6/9] serial: 8250_dwlib: remove redundant sanity check for RS485 flags
    Date
    From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

    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.

    Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    ---
    drivers/tty/serial/8250/8250_dwlib.c | 10 ++--------
    1 file changed, 2 insertions(+), 8 deletions(-)

    diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c
    index a8bbed74ea70..f4ae262d00fb 100644
    --- a/drivers/tty/serial/8250/8250_dwlib.c
    +++ b/drivers/tty/serial/8250/8250_dwlib.c
    @@ -187,16 +187,10 @@ static int dw8250_rs485_config(struct uart_port *p, struct ktermios *termios,
    if (rs485->flags & SER_RS485_ENABLED) {
    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;
    - } 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;
    -
    + else
    tcr |= DW_UART_TCR_XFER_MODE_DE_OR_RE;
    - }
    dw8250_writel_ext(p, DW_UART_DE_EN, 1);
    dw8250_writel_ext(p, DW_UART_RE_EN, 1);
    } else {
    --
    2.25.1
    \
     
     \ /
      Last update: 2022-07-03 19:02    [W:6.517 / U:0.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site