From patchwork Tue Nov 25 08:26:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 5374441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D563C11AC for ; Tue, 25 Nov 2014 08:30:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C85F20154 for ; Tue, 25 Nov 2014 08:30:12 +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 8274F2014A for ; Tue, 25 Nov 2014 08:30:11 +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 1XtBTX-0000F5-1s; Tue, 25 Nov 2014 08:27:55 +0000 Received: from ns.lynxeye.de ([87.118.118.114] helo=lynxeye.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtBTU-0000Ds-GK for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 08:27:53 +0000 Received: by lynxeye.de (Postfix, from userid 501) id 71D2A26C2002; Tue, 25 Nov 2014 09:27:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 Received: from tellur.intern.lynxeye.de (p57B5FBCA.dip0.t-ipconnect.de [87.181.251.202]) by lynxeye.de (Postfix) with ESMTPA id 5220E26C2001; Tue, 25 Nov 2014 09:26:59 +0100 (CET) From: Lucas Stach To: Greg Kroah-Hartman Subject: [PATCH resend] serial: of-serial: fetch line number from DT Date: Tue, 25 Nov 2014 09:26:56 +0100 Message-Id: <1416904016-5567-1-git-send-email-dev@lynxeye.de> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141125_002752_702041_805C7A5B X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.0 (/) Cc: Olof Johansson , "linux-tegra@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Stephen Warren 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-Virus-Scanned: ClamAV using ClamSMTP The general agreed way to specify a fixed line number for a serial console is to provide a "serial" alias in the devicetree. Start parsing this property in of_serial. Signed-off-by: Lucas Stach Acked-by: Olof Johansson --- As 3.16-rc6 landed the fix to avoid the regression that this patch was causing on Tegra it should be safe to reapply it. --- drivers/tty/serial/of_serial.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 8bc2563..920a831 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -101,6 +101,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev, if (of_property_read_u32(np, "fifo-size", &prop) == 0) port->fifosize = prop; + /* Check for a fixed line number */ + if ((ret = of_alias_get_id(np, "serial")) >= 0) + port->line = ret; + port->irq = irq_of_parse_and_map(np, 0); port->iotype = UPIO_MEM; if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {