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: 9664715 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 EA51D602B5 for ; Wed, 5 Apr 2017 16:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD00A28395 for ; Wed, 5 Apr 2017 16:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D19D12847F; Wed, 5 Apr 2017 16:39:37 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 7B0EC28395 for ; Wed, 5 Apr 2017 16:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755724AbdDEQiJ (ORCPT ); Wed, 5 Apr 2017 12:38:09 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:34504 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754783AbdDEQiF (ORCPT ); Wed, 5 Apr 2017 12:38:05 -0400 Received: by mail-wr0-f179.google.com with SMTP id t20so22973165wra.1 for ; Wed, 05 Apr 2017 09:38:05 -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=foummc9hi9Hg21CY4amq4fajKmh4nIy2U+0yBleZuNN1FBssdm0yCUmU3UtIdvee7M wQh42HQAlAZQgreSRFBQZmhVvRRsoKAwMn6dM7NDtx+TvzrI/gJ1AXoLuF2wywGZgcIt rZJ55aK4qaX9yWQJuVeul3Xw4AzyBXi5l/n1z7FUv5/WkwHi+G7gWB7sVZgfP8MOWv7D H0jgEJel+kM2qsIvffugOmtY+fkcfAwkborzUGyZAyQsxgTCtT3btr0bgLP8mIoboLPP Y8p5JI7R+uu/salOVwH4A9rmU+WxwkqH0hM/o3zFoPim6T1OCIOGub52kmUEGpMq8/g5 ln3g== X-Gm-Message-State: AFeK/H3Pw5ZJQWgObJ082So2lv10Tkx5hLWUpRYsHIuVCNTyrF0MUWNI dnU+mvACmOjoFCsI 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: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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);