mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-03 11:43:03 +09:00
serial: 8250_fintek: Fix rs485 disablement on invalid ioctl()
[ Upstream commit3236a96548] This driver's ->rs485_config callback checks if SER_RS485_RTS_ON_SEND and SER_RS485_RTS_AFTER_SEND have the same value. If they do, it means the user has passed in invalid data with the TIOCSRS485 ioctl() since RTS must have a different polarity when sending and when not sending. In this case, rs485 mode is not enabled (the RS485_URA bit is not set in the RS485 Enable Register) and this is supposed to be signaled back to the user by clearing the SER_RS485_ENABLED bit in struct serial_rs485 ... except a missing tilde character is preventing that from happening. Fixes:28e3fb6c4d("serial: Add support for Fintek F81216A LPC to 4 UART") Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Cc: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
429feb597d
commit
a96c19f5ba
@@ -117,7 +117,7 @@ static int fintek_8250_rs485_config(struct uart_port *port,
|
||||
|
||||
if ((!!(rs485->flags & SER_RS485_RTS_ON_SEND)) ==
|
||||
(!!(rs485->flags & SER_RS485_RTS_AFTER_SEND)))
|
||||
rs485->flags &= SER_RS485_ENABLED;
|
||||
rs485->flags &= ~SER_RS485_ENABLED;
|
||||
else
|
||||
config |= RS485_URA;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user