Skip to content

Commit 119264a

Browse files
committed
serial: 8250: Mark txvr_ops as a deprecated interface
We added an interface in 8e9e459 ("8250: Allow client drivers to control tranceivers") for RS-485 transceiver control, but this never went upstream and is also not a requirement for a client driver to implement RS-485 transceiver control. However, this out-of-tree interface got exposed to the NI-Serial drivers, and they were using it for their driver for the NI 987x devices, so we can't (yet) drop it outright. Mark this interface as deprecated and emit a warning when registering a client driver that intends to use it. Upstream-Status: Inappropriate [NI-specific] Signed-off-by: Brenda Streiff <brenda.streiff@ni.com> Acked-by: Gratian Crisan <gratian.crisan@ni.com> Acked-by: Jason Smith <jason.smith@ni.com>
1 parent d8cffba commit 119264a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/tty/serial/8250/8250_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,12 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
10741074
uart->port.serial_out = up->port.serial_out;
10751075
if (up->port.handle_irq)
10761076
uart->port.handle_irq = up->port.handle_irq;
1077-
if (up->port.txvr_ops)
1077+
if (up->port.txvr_ops) {
1078+
dev_warn(uart->port.dev,
1079+
"txvr_ops is deprecated and will be removed in a future release\n");
1080+
10781081
uart->port.txvr_ops = up->port.txvr_ops;
1082+
}
10791083
/* Possibly override set_termios call */
10801084
if (up->port.set_termios)
10811085
uart->port.set_termios = up->port.set_termios;

include/linux/serial_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ struct uart_port {
567567
unsigned int frame_time; /* frame timing in ns */
568568
unsigned int type; /* port type */
569569
const struct uart_ops *ops;
570-
const struct txvr_ops *txvr_ops; /* transceiver ops */
570+
const struct txvr_ops *txvr_ops; /* transceiver ops (deprecated) */
571571
unsigned int custom_divisor;
572572
unsigned int line; /* port index */
573573
unsigned int minor;

0 commit comments

Comments
 (0)