From patchwork Thu Nov 27 17:56:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 5398761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B85B49F2F5 for ; Thu, 27 Nov 2014 17:58:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF0392016C for ; Thu, 27 Nov 2014 17:58:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 133C42013A for ; Thu, 27 Nov 2014 17:58:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xu3JJ-0003eo-6P; Thu, 27 Nov 2014 17:56:57 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xu3Ic-0003FS-Fw for linux-arm-kernel@lists.infradead.org; Thu, 27 Nov 2014 17:56:15 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so18990464wib.3 for ; Thu, 27 Nov 2014 09:55:52 -0800 (PST) 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=SNeSjDthx3DOjTAogOCB82Lkt+ikBQ4+fPawHXUsNLk=; b=XYRSFzxkTIcAQyJvnW4tFxwmTmSeDQNLbP1Q6As97hNgYt3hrZ1jKg3wAfUzwUDdSS 05paCZzd+7P7addW2HXFQ0a6XYbqpNBUPrM3cYZ9WKMOcpsQ7X2V04zWXSKJgwFwT6Dz ayNOSaFff547ZIO3MZEOqUAKKRoyIX79tHId/6c5OTIc2cHkdML4Cr3D3rH1BxLmE/sV 9eVldVlWzH8324yJbCmYfALPpsdOKijfvt6bVvtCBuWMv8z0MLmdwN7MXdGGuTP8zdh7 ROFT4/Z8vTkLwISNAtqfdq+xbg9iOq4VjVXyb+njBm5Ffiksl/fzy0syFGFwnK+QsMab ssbw== X-Gm-Message-State: ALoCoQmcpZclV1FVTVPP6CwLdx3I8to1n9Dpgooixw+eNRnY0aUOYkQjxe7LlGTZkxqCeqdL7NrW X-Received: by 10.180.198.164 with SMTP id jd4mr52519571wic.42.1417110952656; Thu, 27 Nov 2014 09:55:52 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id nj9sm12404437wic.10.2014.11.27.09.55.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 09:55:52 -0800 (PST) From: Leif Lindholm To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] of: support passing console options with stdout-path Date: Thu, 27 Nov 2014 17:56:07 +0000 Message-Id: <1417110967-16284-4-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417110967-16284-1-git-send-email-leif.lindholm@linaro.org> References: <1417110967-16284-1-git-send-email-leif.lindholm@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141127_095614_734695_B2FE2C9D X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: mark.rutland@arm.com, andrew@lunn.ch, s.hauer@pengutronix.de, robh+dt@kernel.org, ijc@debian.org, grant.likely@linaro.org, plagnioj@jcrosoft.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Support specifying console options (like with console=ttyXN,) by appending them to the stdout-path property after a separating ':'. Example: stdout-path = "uart0:115200"; Signed-off-by: Leif Lindholm --- drivers/of/base.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 7f0e5f7..6d2d45e 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -37,6 +37,7 @@ EXPORT_SYMBOL(of_allnodes); struct device_node *of_chosen; struct device_node *of_aliases; struct device_node *of_stdout; +static const char *of_stdout_options; struct kset *of_kset; @@ -1844,7 +1845,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) if (IS_ENABLED(CONFIG_PPC) && !name) name = of_get_property(of_aliases, "stdout", NULL); if (name) - of_stdout = of_find_node_by_path(name); + of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); } if (!of_aliases) @@ -1968,9 +1969,13 @@ EXPORT_SYMBOL_GPL(of_prop_next_string); */ bool of_console_check(struct device_node *dn, char *name, int index) { + char *console_options; + if (!dn || dn != of_stdout || console_set_on_cmdline) return false; - return !add_preferred_console(name, index, NULL); + + console_options = kstrdup(of_stdout_options, GFP_KERNEL); + return !add_preferred_console(name, index, console_options); } EXPORT_SYMBOL_GPL(of_console_check);