diff options
author | Lukas Wunner <lukas@wunner.de> | 2020-02-28 14:31:03 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-07 09:52:01 +0100 |
commit | 283e096ffb7077c2b677eee043ff36965e43d37b (patch) | |
tree | e11e266b6e348585ee931265c7b2a5887f0fa770 /drivers/tty/serial/8250/8250.h | |
parent | fe7f0fa43cef191a6d17bedf90bacce806c58eba (diff) | |
download | lwn-283e096ffb7077c2b677eee043ff36965e43d37b.tar.gz lwn-283e096ffb7077c2b677eee043ff36965e43d37b.zip |
serial: 8250: Deduplicate ->rs485_config() callback
Commit e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
introduced support to use RTS as an rs485 Transmit Enable signal.
Drivers opt in to the feature by calling serial8250_em485_init() from
their ->rs485_config() callback.
So far there are two drivers doing that, 8250_omap.c and 8250_of.c.
Both use an identical callback. We're about to add a third user of that
callback, therefore deduplicate it and move it to 8250_port.c.
Drivers now opt in to rs485 software emulation by assigning the generic
serial8250_rs485_config() callback introduced herein to their
.rs485_config struct member. This change allows unexporting
serial8250_em485_init() and declaring it static.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Matwey V. Kornilov <matwey@sai.msu.ru>
Cc: Heiko Schocher <hs@denx.de>
Link: https://lore.kernel.org/r/fcef63642dc4eae41ae7842d23747b2bf5d40285.1582895077.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250.h')
-rw-r--r-- | drivers/tty/serial/8250/8250.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 32881e21b0c8..83a85210501f 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -156,7 +156,7 @@ void serial8250_rpm_put(struct uart_8250_port *p); void serial8250_rpm_get_tx(struct uart_8250_port *p); void serial8250_rpm_put_tx(struct uart_8250_port *p); -int serial8250_em485_init(struct uart_8250_port *p); +int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485); void serial8250_em485_destroy(struct uart_8250_port *p); /* MCR <-> TIOCM conversion */ |