From patchwork Fri Dec 21 09:45:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 1902721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 32F30DF25A for ; Fri, 21 Dec 2012 09:50:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TlzC1-00066K-J5; Fri, 21 Dec 2012 09:47:01 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TlzAt-0005i0-UP for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2012 09:45:53 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj3so2712139pad.14 for ; Fri, 21 Dec 2012 01:45:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=b9kbiHN16v7fFR9rYTWqiUAigQseJ1bnmi82s8NMG5U=; b=MsJv1uwtm2I3z6JUtdVn2GZ6xi+GQPg/ehUOUT59hR/NNdmUpRjZx11UQIzFx1+S9+ VCDvG6LOIwL30wwdJswEaJQvaE9r5GaXI/PQibm1cvgQakNHOktb7CECKfe81Og18l4f FE1ubu+fqod4mWR9o1xH8oNWQdYm0/D4FmBimDqEIlUwOSYXkvP+aZ8fMSyujbM1UGjl zeYdSyhJ10GxIhe8L7Pu5YqTZCK2nUzd1n4aXketc3yWqDspRsCxHA44GigOi2YXpRca x/1LV4fKQzduDjrZT2p/uPEXeeXYsIRE9h1zyC02eCjEPN67OS1qeIU+j8eWjJwNc9c7 UPdQ== X-Received: by 10.66.73.230 with SMTP id o6mr35492278pav.57.1356083150162; Fri, 21 Dec 2012 01:45:50 -0800 (PST) Received: from localhost.localdomain ([116.224.148.148]) by mx.google.com with ESMTPS id t5sm7104258paw.20.2012.12.21.01.45.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 01:45:49 -0800 (PST) From: Haojian Zhuang To: linus.walleij@linaro.org, tony@atomide.com, linux-arm-kernel@lists.infradead.org, swarren@nvidia.com Subject: [PATCH v6 6/8] tty: pxa: configure pin Date: Fri, 21 Dec 2012 17:45:16 +0800 Message-Id: <1356083118-18857-7-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356083118-18857-1-git-send-email-haojian.zhuang@linaro.org> References: <1356083118-18857-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQnXaqM0kNbToKlnOsfMBWK6JYtQ7nZCMxpdPdfpEjYtyjwG88fjd62cox7NndY78apNr1+s X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121221_044552_159748_FB839885 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.41 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 From: Haojian Zhuang Configure pins by pinctrl driver. Signed-off-by: Haojian Zhuang Acked-by: Linus Walleij --- drivers/tty/serial/pxa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 2764828..4492c1d 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -864,6 +865,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) @@ -874,6 +876,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; } @@ -912,7 +918,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);