From patchwork Mon Aug 18 09:32:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 380836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id E89FA14009B; Mon, 18 Aug 2014 19:36:05 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XJJMA-0006Fi-WB; Mon, 18 Aug 2014 09:36:02 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XJJLd-0005x6-Qh for kernel-team@lists.ubuntu.com; Mon, 18 Aug 2014 09:35:29 +0000 Received: from bl16-84-65.dsl.telepac.pt ([188.81.84.65] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XJJLd-0002H9-BE; Mon, 18 Aug 2014 09:35:29 +0000 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 3.11 087/137] can: c_can_platform: Fix raminit, use devm_ioremap() instead of devm_ioremap_resource() Date: Mon, 18 Aug 2014 10:32:28 +0100 Message-Id: <1408354398-10226-88-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408354398-10226-1-git-send-email-luis.henriques@canonical.com> References: <1408354398-10226-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.11 Cc: Mugunthan V N , George Cherian , Marc Kleine-Budde X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.11.10.15 -stable review patch. If anyone has any objections, please let me know. ------------------ From: George Cherian commit 33cf75656923ff11d67a937a4f8e9344f58cea77 upstream. The raminit register is shared register for both can0 and can1. Since commit: 32766ff net: can: Convert to use devm_ioremap_resource devm_ioremap_resource() is used to map raminit register. When using both interfaces the mapping for the can1 interface fails, leading to a non functional can interface. Signed-off-by: George Cherian Signed-off-by: Mugunthan V N Signed-off-by: Marc Kleine-Budde [ luis: backported to 3.11: adjusted context ] Signed-off-by: Luis Henriques --- drivers/net/can/c_can/c_can_platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index c6f838d922a5..5d39bc152c5e 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c @@ -194,7 +194,8 @@ static int c_can_plat_probe(struct platform_device *pdev) priv->instance = pdev->id; res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res); + priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) dev_info(&pdev->dev, "control memory is not used for raminit\n"); else