Skip to content

Commit 7bdf59c

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
serial: 8250: extract serial8250_init_mctrl()
After commit 7951586 ("serial: 8250: extract serial8250_initialize()"), split serial8250_initialize() even more -- the mctrl part of this code can be separated into serial8250_init_mctrl() -- done now. Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Suggested-by: Ilpo Järvinen <[email protected]> Cc: Andy Shevchenko <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d22cf13 commit 7bdf59c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

drivers/tty/serial/8250/8250_port.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,15 +2216,8 @@ static void serial8250_THRE_test(struct uart_port *port)
22162216
up->bugs |= UART_BUG_THRE;
22172217
}
22182218

2219-
static void serial8250_initialize(struct uart_port *port)
2219+
static void serial8250_init_mctrl(struct uart_port *port)
22202220
{
2221-
struct uart_8250_port *up = up_to_u8250p(port);
2222-
unsigned long flags;
2223-
bool lsr_TEMT, iir_NOINT;
2224-
2225-
serial_port_out(port, UART_LCR, UART_LCR_WLEN8);
2226-
2227-
uart_port_lock_irqsave(port, &flags);
22282221
if (port->flags & UPF_FOURPORT) {
22292222
if (!port->irq)
22302223
port->mctrl |= TIOCM_OUT1;
@@ -2235,6 +2228,18 @@ static void serial8250_initialize(struct uart_port *port)
22352228
}
22362229

22372230
serial8250_set_mctrl(port, port->mctrl);
2231+
}
2232+
2233+
static void serial8250_initialize(struct uart_port *port)
2234+
{
2235+
struct uart_8250_port *up = up_to_u8250p(port);
2236+
unsigned long flags;
2237+
bool lsr_TEMT, iir_NOINT;
2238+
2239+
serial_port_out(port, UART_LCR, UART_LCR_WLEN8);
2240+
2241+
uart_port_lock_irqsave(port, &flags);
2242+
serial8250_init_mctrl(port);
22382243

22392244
/*
22402245
* Serial over Lan (SoL) hack:

0 commit comments

Comments
 (0)