diff mbox

[9/9] tty: serial_core: add tty NULL check in uart_port_startup

Message ID 20160909223711.26238-10-robh@kernel.org
State New
Headers show

Commit Message

Rob Herring Sept. 9, 2016, 10:37 p.m. UTC
If we don't have a tty when calling uart_port_startup, skip the baudrate
and modem control setup which depend on tty->termios struct. Either
tty_port clients will configure the line in a separate call or we'll
move termios into the tty_port.

Signed-off-by: Rob Herring <robh@kernel.org>

---
 drivers/tty/serial/serial_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.3
diff mbox

Patch

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b9ec9fd688a2..2c3b187d517b 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -199,7 +199,7 @@  static int uart_port_startup(struct tty_port *port, int init_hw)
 	}
 
 	retval = uport->ops->startup(uport);
-	if (retval == 0) {
+	if (retval == 0 && tty) {
 		if (uart_console(uport) && uport->cons->cflag) {
 			tty->termios.c_cflag = uport->cons->cflag;
 			uport->cons->cflag = 0;