From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755735AbcIIWhd (ORCPT ); Fri, 9 Sep 2016 18:37:33 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:34593 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755645AbcIIWh2 (ORCPT ); Fri, 9 Sep 2016 18:37:28 -0400 From: Rob Herring To: Alan Cox , Greg Kroah-Hartman , Jiri Slaby , Peter Hurley Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 9/9] tty: serial_core: add tty NULL check in uart_port_startup Date: Fri, 9 Sep 2016 17:37:10 -0500 Message-Id: <20160909223711.26238-10-robh@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909223711.26238-1-robh@kernel.org> References: <20160909223711.26238-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/tty/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.9.3