From patchwork Fri Mar 28 16:08:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 27319 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 07F1520545 for ; Fri, 28 Mar 2014 16:10:03 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf18585064oag.10 for ; Fri, 28 Mar 2014 09:10:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=qvsYccdiCnkTlues3v+gE1ClVtUEeuHkJvMRM2bu0PA=; b=V5+DLl22wzRDtVbDU9xFCMyU7hy2kniAVbLeFl5J5FTCY1Z3/hF0za97N5qfrqyal2 K3yVIaZvMrahfOiYzoMDUNcKVp1gWa7P/3txUM7HgS7itenN1ImGhjJL95tL0Uk3jv+Q 8ix0anijQ9ILBveehK8Oxjzrq0ucgaH5OGiAi1WHS5qWwr6w3gvnyvgWdjyJ5QlQgr7y bo+pXXkw4AIw+f2wTKcRxEALqIrxExpGRJ4vKR0bPgceu0xZUnzAwozzJxaDayC7jGZq INYnqTsPPd+KNTbPJD3IS343maMEmW46ZP4b1CXkR1W1dPpmbbVyujx8444UC+adRh26 Igww== X-Gm-Message-State: ALoCoQk9e0x4+ZTnyRtHrkLj00toqfgvFm8eVQ1cptNYt6QUQr/PXeba9CyzvysxUx77EuENgyYD X-Received: by 10.182.24.134 with SMTP id u6mr3541783obf.24.1396023002989; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.103 with SMTP id k94ls963545qgd.93.gmail; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr6506067vdc.1.1396023002873; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id kj3si1311006vdb.195.2014.03.28.09.10.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:10:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if17so5935167vcb.22 for ; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr7991493vcx.12.1396023002797; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp20491vcv; Fri, 28 Mar 2014 09:10:02 -0700 (PDT) X-Received: by 10.68.12.133 with SMTP id y5mr9491097pbb.134.1396023001913; Fri, 28 Mar 2014 09:10:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tk5si3957505pbc.123.2014.03.28.09.10.01; Fri, 28 Mar 2014 09:10:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbaC1QKA (ORCPT + 9 others); Fri, 28 Mar 2014 12:10:00 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33334 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbaC1QIQ (ORCPT ); Fri, 28 Mar 2014 12:08:16 -0400 Received: by mail-pa0-f48.google.com with SMTP id hz1so5203616pad.21 for ; Fri, 28 Mar 2014 09:08:16 -0700 (PDT) X-Received: by 10.68.133.229 with SMTP id pf5mr9451004pbb.115.1396022896032; Fri, 28 Mar 2014 09:08:16 -0700 (PDT) Received: from trevor.secretlab.ca ([184.48.92.32]) by mx.google.com with ESMTPSA id iu10sm24821127pbd.71.2014.03.28.09.08.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:08:14 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id 7A13AC4200D; Fri, 28 Mar 2014 16:08:10 +0000 (GMT) From: Grant Likely To: devicetree@vger.kernel.org, christoffer.dall@linaro.org, linux-kernel@vger.kernel.org, olof@lixom.net, benh@kernel.crashing.org, rob.herring@linaro.org Cc: Grant Likely Subject: [RFC 3/5] of: Enable console on serial ports specified by /chosen/stdout-path Date: Fri, 28 Mar 2014 09:08:03 -0700 Message-Id: <1396022885-6102-4-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1396022885-6102-1-git-send-email-grant.likely@linaro.org> References: <1396022885-6102-1-git-send-email-grant.likely@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If the devicetree specifies a serial port as a stdout device, then the kernel can use it as the default console if nothing else was selected on the command line. For any serial port that uses the uart_add_one_port() feature, the uart_add_one_port() has all the information needed to automatically enable the console device, which is what this patch does. With this change applied, a device tree platform can be booted without any console= parameters on the command line and the kernel will still be able to determine its console. Signed-off-by: Grant Likely --- drivers/tty/serial/serial_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index ece2049bd270..2fac7593d7b2 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -2604,6 +2605,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) spin_lock_init(&uport->lock); lockdep_set_class(&uport->lock, &port_lock_key); } + if (uport->cons && uport->dev) + of_console_check(uport->dev->of_node, uport->cons->name, uport->line); uart_configure_port(drv, state, uport);