From patchwork Wed Apr 5 16:35:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9664713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D552602B5 for ; Wed, 5 Apr 2017 16:39:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6020628395 for ; Wed, 5 Apr 2017 16:39:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5493028477; Wed, 5 Apr 2017 16:39:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 744A8284DB for ; Wed, 5 Apr 2017 16:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755578AbdDEQiJ (ORCPT ); Wed, 5 Apr 2017 12:38:09 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:36464 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755531AbdDEQiD (ORCPT ); Wed, 5 Apr 2017 12:38:03 -0400 Received: by mail-wr0-f175.google.com with SMTP id w11so21047799wrc.3 for ; Wed, 05 Apr 2017 09:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ALW1iEYdWT5QLDItyKvBp//+zM53mXjNR4u2MPnEEL4=; b=Ir5C69BBbxjWeK4LusGbepBvvzsUoaXe0/QvMlaopvBw/fdMMuzkGwH2nD3txFF2eB a3/ij2cm5/u6EZbGaK5NT/DrR4136ZZpndnZ3dljlgOsw17SCpCcZ/D7tj+6bYmlGngm 2PY0jLUfLIYTTdEGC/sX2ld2c3YS7075thgm2lNb91MXaOejQyOdYazUrZLNgzN8cIif f0NN1CSypX1IM3GQIDQO2ak5b0A5p52TcJhzb8cAxspuE+6VOZjQ8tJYrd8iAR9sP5yj bV2/vITp9G/Zh/zvWYXKm/FA2oYfRgYmaMoy0zHbOFnOKUSU8EixtSD+1HdbemI6weD2 TJTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ALW1iEYdWT5QLDItyKvBp//+zM53mXjNR4u2MPnEEL4=; b=XzgLazCv3L51tOYuiK9MoLRM1MxHPpv5awKvp/ryVG3NYPaNT3eh7IJVqDiPIzgeJs dLdi5KaCKpOE0fq/mFoJcU4q3bcDYWVAJAIhUIN/OyMh1ytBqPN+Ps7MxosRp3TcuOiv woNZI+iFVsfsaPqeqQhBqjEdvswelFPiS3sdN+isj0fVJQhjschv9etMyCJeSbK/F+g9 SLc2y7qUioi7cpPME/7819sKExxEMs3x98lXCsWtxLzVIIg8zwNRNjlrq4Jw0qVayJyA 6laH1vL4T9Tq2qbZDvG7VocL2r5gpDGq/RDU4AYjULSchbZqF+mzxWyf8Fx+nT0ioUoX 3cSQ== X-Gm-Message-State: AFeK/H2yCukwEfTDY5xPfKd5cUBlAH96qfFXQ0y0XxyNVXwojC7ECyrv ZZroPsealuj2Nuri X-Received: by 10.28.1.209 with SMTP id 200mr20155581wmb.74.1491410281398; Wed, 05 Apr 2017 09:38:01 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id w85sm22904486wmw.1.2017.04.05.09.38.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Apr 2017 09:38:00 -0700 (PDT) From: Alexandre Bailon To: vinod.koul@intel.com Cc: dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, tony@atomide.com, Alexandre Bailon Subject: [PATCH][linux-next] dmaengine: cppi41: Fix an Oops happening in cppi41_dma_probe() Date: Wed, 5 Apr 2017 18:35:16 +0200 Message-Id: <20170405163516.13627-1-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fix an Oops happening on all platforms using the old dt bindings (all platforms but da8xx). This update cppi41_dma_probe() to use the index variable which is required to keep compatibility between old and new dt bindings. Fixes: 8e3ba95f4190 ("dmaengine: cppi41: use managed functions devm_*()") Reported-by: Tony Lindgren Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 0be56c9..f7e965f 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -1038,17 +1038,17 @@ static int cppi41_dma_probe(struct platform_device *pdev) if (index < 0) return index; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + mem = platform_get_resource(pdev, IORESOURCE_MEM, index); cdd->ctrl_mem = devm_ioremap_resource(dev, mem); if (IS_ERR(cdd->ctrl_mem)) return PTR_ERR(cdd->ctrl_mem); - mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); + mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 1); cdd->sched_mem = devm_ioremap_resource(dev, mem); if (IS_ERR(cdd->sched_mem)) return PTR_ERR(cdd->sched_mem); - mem = platform_get_resource(pdev, IORESOURCE_MEM, 2); + mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 2); cdd->qmgr_mem = devm_ioremap_resource(dev, mem); if (IS_ERR(cdd->qmgr_mem)) return PTR_ERR(cdd->qmgr_mem);