From patchwork Fri Sep 9 22:37:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 75924 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp569870qgf; Fri, 9 Sep 2016 15:37:51 -0700 (PDT) X-Received: by 10.66.148.202 with SMTP id tu10mr10742500pab.52.1473460669283; Fri, 09 Sep 2016 15:37:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k88si5958679pfa.274.2016.09.09.15.37.49; Fri, 09 Sep 2016 15:37:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932109AbcIIWhe (ORCPT + 27 others); Fri, 9 Sep 2016 18:37:34 -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 Received: by mail-oi0-f68.google.com with SMTP id a144so4268346oii.1; Fri, 09 Sep 2016 15:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZQPjnO760Iy+cdUszWlDZUkh0oOjMBPZPyh5YmV7cKs=; b=GhvbN2sahYWSMaxoz6nyckXwcqrbMGsTIuV2mZcGSg7fq2ySsbXrxzN8eDfPKVtJnL c065DrAfxJkpS3yTQ4ajusHvtq9hQPJeFf9o7LU/Rt2Gh/XY2GljYflTZccej4pBj7pP cUmbwwgq44OvGknpfhF62VHP7BCLOKXQdqppGSeCtalUW20xrRbV0vX16212Oi5RkAwm uzYpQ7vCdZg4ltcR53p+CMveWPiv3GNvJE+/TW8iSIC8ZL2mNp9A48DNw6vBx0PCGWYu w6MasQ5pvMqSqeA36MhOojy49Cn5+HSV7+oT7DW1Om1YEwF18QVUwwLlnrZVm10hZOu4 ah7g== X-Gm-Message-State: AE9vXwOsnCYmstvSumaOMdhGXF6pnb74xgumgUSkpcTPwfT2lwwf2khKe2byFrrHo04uGA== X-Received: by 10.202.170.199 with SMTP id t190mr9866664oie.120.1473460642738; Fri, 09 Sep 2016 15:37:22 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id v185sm1902378oie.24.2016.09.09.15.37.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Sep 2016 15:37:22 -0700 (PDT) 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 Precedence: bulk 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(-) -- 2.9.3 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;