Skip to content

Commit

Permalink
serial: 8250: Decouple core from skip_txen_test module param
Browse files Browse the repository at this point in the history
Prepare for 8250 split; initialize the port flags based on the
"skip_txen_test" module param to use the existing flag test.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Mar 26, 2015
1 parent d81e50f commit e13cb72
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/tty/serial/8250/8250_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ int serial8250_do_startup(struct uart_port *port)
is variable. So, let's just don't test if we receive
TX irq. This way, we'll never enable UART_BUG_TXEN.
*/
if (skip_txen_test || up->port.flags & UPF_NO_TXEN_TEST)
if (up->port.flags & UPF_NO_TXEN_TEST)
goto dont_test_tx_en;

/*
Expand Down Expand Up @@ -3196,6 +3196,9 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)

up->port.dev = dev;

if (skip_txen_test)
up->port.flags |= UPF_NO_TXEN_TEST;

if (up->port.flags & UPF_FIXED_TYPE)
serial8250_init_fixed_type_port(up, up->port.type);

Expand Down Expand Up @@ -3663,6 +3666,9 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
if (up->port.dev)
uart->port.dev = up->port.dev;

if (skip_txen_test)
uart->port.flags |= UPF_NO_TXEN_TEST;

if (up->port.flags & UPF_FIXED_TYPE)
serial8250_init_fixed_type_port(uart, up->port.type);

Expand Down Expand Up @@ -3728,6 +3734,8 @@ void serial8250_unregister_port(int line)
uart_remove_one_port(&serial8250_reg, &uart->port);
if (serial8250_isa_devs) {
uart->port.flags &= ~UPF_BOOT_AUTOCONF;
if (skip_txen_test)
uart->port.flags |= UPF_NO_TXEN_TEST;
uart->port.type = PORT_UNKNOWN;
uart->port.dev = &serial8250_isa_devs->dev;
uart->capabilities = 0;
Expand Down

0 comments on commit e13cb72

Please sign in to comment.