From patchwork Tue Jan 27 04:50:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 5714411 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B94D9F1D6 for ; Tue, 27 Jan 2015 04:52:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73A78201BB for ; Tue, 27 Jan 2015 04:52: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 B0C00201B9 for ; Tue, 27 Jan 2015 04:52:53 +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 1YFy7O-0006cl-SV; Tue, 27 Jan 2015 04:51:14 +0000 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFy7M-0006aS-3E for linux-arm-kernel@lists.infradead.org; Tue, 27 Jan 2015 04:51:12 +0000 Received: by mail-ob0-f175.google.com with SMTP id wp4so11625738obc.6 for ; Mon, 26 Jan 2015 20:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=7Hc+pXq/0wHsjFaD9wQHlMynZq62zLHyc5yFZ7hmdAE=; b=hDiteeWzvjaNW6in/eR+7A69Dh+PZMJtUG4/WcVoKamak6Hr3sUzdJKteLa/J5Sunz qHrwm45xw5rvnMFSRBRkHtAr6kcFXl/JFInBuOnn2/FM8XGWAi4NflkgvGDoico9Y8+2 Q+LYXgiGIAY6U0fJMgkD9akYP1TXQoa3uTNleRlnPUNiC4V/Ne2e8tMIMc1tDUSvnx0c xzMvFM9QsrRDXaylP+o+PA9LLY49lofF9rquYsmFxx0OQrrNphkut6orYXnmDAM+v1k3 FoQLRfzljqUuvE6Zvlvspx3u3F0nm3XC2yaRIpNMYmwamm1bUACF4n/Zd1geXGouC95l OnuA== X-Received: by 10.202.94.197 with SMTP id s188mr509892oib.94.1422334249708; Mon, 26 Jan 2015 20:50:49 -0800 (PST) Received: from rob-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by mx.google.com with ESMTPSA id v187sm109780oie.2.2015.01.26.20.50.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jan 2015 20:50:48 -0800 (PST) From: Rob Herring To: linux-serial@vger.kernel.org Subject: [PATCH 1/3] tty/serial: of_serial: add DT alias ID handling Date: Mon, 26 Jan 2015 22:50:07 -0600 Message-Id: <1422334209-23125-1-git-send-email-robh@kernel.org> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150126_205112_194413_FDC5CA79 X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.4 (/) Cc: Rob Herring , Jiri Slaby , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Add support for alias parsing from the DT. This allows for consistent tty numbering. Signed-off-by: Rob Herring Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org --- 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 64f1bab..3194b42 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -128,6 +128,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev, if (of_find_property(np, "no-loopback-test", NULL)) port->flags |= UPF_SKIP_TEST; + ret = of_alias_get_id(np, "serial"); + if (ret >= 0) + port->line = ret; + port->dev = &ofdev->dev; switch (type) {