From patchwork Thu Oct 30 14:58:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien CHAUVEAU X-Patchwork-Id: 5198251 Return-Path: X-Original-To: patchwork-linux-rockchip@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 6FD909F30B for ; Thu, 30 Oct 2014 15:05:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D6A9201ED for ; Thu, 30 Oct 2014 15:05:32 +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 12DF8201FE for ; Thu, 30 Oct 2014 15:05:31 +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 1XjrI2-0005Wt-LP; Thu, 30 Oct 2014 15:05:30 +0000 Received: from 4.mo68.mail-out.ovh.net ([46.105.59.63] helo=mo68.mail-out.ovh.net) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjrI0-000545-As for linux-rockchip@lists.infradead.org; Thu, 30 Oct 2014 15:05:28 +0000 Received: from mail642.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo68.mail-out.ovh.net (Postfix) with SMTP id 2B5C9FFB818 for ; Thu, 30 Oct 2014 16:04:59 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 30 Oct 2014 17:04:58 +0200 Received: from laubervilliers-656-01-116-88.w193-248.abo.wanadoo.fr (HELO mail.neo-technologies.fr) (technique@neo-electronics.fr@193.248.240.88) by ns0.ovh.net with SMTP; 30 Oct 2014 17:04:56 +0200 Received: from pandora.neo-technologies.fr (unknown [192.168.0.105]) by mail.neo-technologies.fr (Postfix) with ESMTPSA id 36EB5600A; Thu, 30 Oct 2014 16:04:53 +0100 (CET) From: Julien CHAUVEAU To: gregkh@linuxfoundation.org Subject: [PATCH] serial: 8250_dw: get index of serial line from DT aliases Date: Thu, 30 Oct 2014 15:58:49 +0100 Message-Id: <1414681129-10578-1-git-send-email-julien.chauveau@neo-technologies.fr> X-Mailer: git-send-email 2.1.0 X-Ovh-Tracer-Id: 6023564503345135734 X-Ovh-Remote: 193.248.240.88 (laubervilliers-656-01-116-88.w193-248.abo.wanadoo.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrfeduucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrfeduucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141030_080528_522146_E12A03BD X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: linux-rockchip@lists.infradead.org, jslaby@suse.cz, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Julien CHAUVEAU X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Get index of serial line from device tree using function of_alias_get_id(). If no alias is found, the 8250 core takes care of incrementing the line number. Signed-off-by: Julien CHAUVEAU --- drivers/tty/serial/8250/8250_dw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index beea6ca..5416355 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -293,6 +293,11 @@ static int dw8250_probe_of(struct uart_port *p, if (!of_property_read_u32(np, "reg-shift", &val)) p->regshift = val; + /* get index of serial line, if found in DT aliases */ + val = of_alias_get_id(np, "serial"); + if (val >= 0) + p->line = val; + /* clock got configured through clk api, all done */ if (p->uartclk) return 0;