From patchwork Fri Mar 8 17:30:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Desroches X-Patchwork-Id: 2239821 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 5CE87DF215 for ; Fri, 8 Mar 2013 17:40:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UE1Cl-0004Oj-ER; Fri, 08 Mar 2013 17:35:43 +0000 Received: from eusmtp01.atmel.com ([212.144.249.243]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UE194-0002Q3-I8 for linux-arm-kernel@lists.infradead.org; Fri, 08 Mar 2013 17:31:51 +0000 Received: from ibiza.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.2.318.4; Fri, 8 Mar 2013 18:31:44 +0100 From: To: , , Subject: [PATCH 2/3] can: at91_can: add pinctrl support Date: Fri, 8 Mar 2013 18:30:41 +0100 Message-ID: <1362763842-14924-3-git-send-email-ludovic.desroches@atmel.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1362763842-14924-1-git-send-email-ludovic.desroches@atmel.com> References: <1362763842-14924-1-git-send-email-ludovic.desroches@atmel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130308_123150_881686_E3A86106 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: plagnioj@jcrosoft.com, mkl@pengutronix.de, Ludovic Desroches , nicolas.ferre@atmel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Ludovic Desroches Signed-off-by: Ludovic Desroches --- drivers/net/can/at91_can.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index c7f70d4..56fb2aa 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1292,6 +1293,7 @@ static int at91_can_probe(struct platform_device *pdev) struct clk *clk; void __iomem *addr; int err, irq; + struct pinctrl *pinctrl; devtype_data = at91_can_get_driver_data(pdev); if (!devtype_data) { @@ -1314,6 +1316,13 @@ static int at91_can_probe(struct platform_device *pdev) goto exit_put; } + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) { + dev_err(&pdev->dev, "Failed to request pinctrl\n"); + err = PTR_ERR(pinctrl); + goto exit_put; + } + if (!request_mem_region(res->start, resource_size(res), pdev->name)) {