]> git.baikalelectronics.ru Git - kernel.git/commit
serial: Clear rs485 struct when non-RS485 mode is set
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 6 Jun 2022 10:04:20 +0000 (13:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:49:57 +0000 (13:49 +0200)
commit71bc222c52430f21d88231c1ff04de2821dfddd5
tree59883d747e2a3a96c55e7ae4ecced3311dc31eea
parent187c574aabd8bf5b68b54bd1e1bf0d6080a6880d
serial: Clear rs485 struct when non-RS485 mode is set

When SER_RS485_ENABLED is not set, having any other flag/field set in
serial_rs485 struct does not have an effect different from not having
them set. Thus, make the serial_rs485 struct also match the behavior
for all flags, not just SER_RS485_ENABLED.

Some drivers do similar clearing of rs485 struct in their
rs485_config() already, but not all. This change makes the behavior
consistent across drivers.

Don't try to validate rs485 struct further when no RS485 is requested,
this silences some bogus warnings.

This change has (minor) userspace visible impact.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220606100433.13793-24-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c