From patchwork Mon Oct 22 16:08:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 1626881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 628FA4020F for ; Mon, 22 Oct 2012 16:14:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQKbf-0005cJ-6C; Mon, 22 Oct 2012 16:11:59 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQKb7-000529-4N for linux-arm-kernel@lists.infradead.org; Mon, 22 Oct 2012 16:11:25 +0000 Received: by mail-pb0-f49.google.com with SMTP id xa7so1989904pbc.36 for ; Mon, 22 Oct 2012 09:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=8C2AhWQ2bBZ27cy9fIjYn8iKMXKu6rog+5ih3aJQsv4=; b=uLdKy/sZ6hC4a1WxmkiqCiWsubhA3gd+ENgNZvPeDOJwjTPNhTA7gjYjHZwNpU4Grh AORz0C3cx1uXhlekK1uuPFtxIZ4YhGf6L5NcMqW+tx7Mde68dlf8T13ZV+VOdbPXzVoQ Yh1/8+ZhrcPiesSu1B4R7jlaNnVMl2HCXpHREJSDj0/Q8bn5VfTqDJc7A6HgdFqrXjp1 rmQNDtTcEp4BJ4OxhHDRSnAXtd3uKR4zXfsbA/WN152a/x4sjq7cj7TeabB6OdN4YLDc evCEaW1H+8BJvc2/9JweAjXDqQBoUKFZ/wsQLmN8/Mlzjy2NuB59aDo/RWdZ5MJWi5vZ 1Ztw== Received: by 10.66.73.226 with SMTP id o2mr27015432pav.83.1350922284867; Mon, 22 Oct 2012 09:11:24 -0700 (PDT) Received: from localhost ([58.39.221.134]) by mx.google.com with ESMTPS id kr4sm6134520pbc.76.2012.10.22.09.11.02 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 09:11:23 -0700 (PDT) From: Haojian Zhuang To: swarren@wwwdotorg.org, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, tony@atomide.com, devicetree-discuss@lists.ozlabs.org, linus.walleij@linaro.org Subject: [PATCH v2 6/9] tty: pxa: configure pin Date: Tue, 23 Oct 2012 00:08:56 +0800 Message-Id: <1350922139-3693-7-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350922139-3693-1-git-send-email-haojian.zhuang@gmail.com> References: <1350922139-3693-1-git-send-email-haojian.zhuang@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (haojian.zhuang[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Configure pins by pinctrl driver. Signed-off-by: Haojian Zhuang Acked-by: Linus Walleij --- drivers/tty/serial/pxa.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 9033fc6..02dc771 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -809,6 +810,7 @@ static int serial_pxa_probe_dt(struct platform_device *pdev, struct uart_pxa_port *sport) { struct device_node *np = pdev->dev.of_node; + struct pinctrl *pinctrl; int ret; if (!np) @@ -819,6 +821,10 @@ static int serial_pxa_probe_dt(struct platform_device *pdev, dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); return ret; } + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + return -EPROBE_DEFER; + sport->port.line = ret; return 0; } @@ -857,7 +863,7 @@ static int serial_pxa_probe(struct platform_device *dev) ret = serial_pxa_probe_dt(dev, sport); if (ret > 0) sport->port.line = dev->id; - else if (ret < 0) + if (ret < 0) goto err_clk; snprintf(sport->name, PXA_NAME_LEN - 1, "UART%d", sport->port.line + 1);