From patchwork Thu Mar 17 09:39:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102554 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp352719lbc; Thu, 17 Mar 2016 02:39:42 -0700 (PDT) X-Received: by 10.66.119.202 with SMTP id kw10mr13276455pab.110.1458207582267; Thu, 17 Mar 2016 02:39:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si2712166pfj.121.2016.03.17.02.39.42; Thu, 17 Mar 2016 02:39:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935440AbcCQJjj (ORCPT + 1 other); Thu, 17 Mar 2016 05:39:39 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:55274 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935410AbcCQJje (ORCPT ); Thu, 17 Mar 2016 05:39:34 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M580s-1ZsUJU3DJe-00zGOA; Thu, 17 Mar 2016 10:39:26 +0100 From: Arnd Bergmann To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: Arnd Bergmann , Kalle Valo , Hauke Mehrtens , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] bcma: use of_dma_configure() to set initial dma mask Date: Thu, 17 Mar 2016 10:39:17 +0100 Message-Id: <1458207563-3453369-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:WuwvAo3sMqlZTJr5hRjwzrlm47vNMx5zeH5CTxunfKKjYkNUsTB ZyMx2/W8JqkSCL7nHrFL8NMaCxhwvqgPtzwmqcsF/+k/xQexvqDeOfQ9HtALNZ4fzZi3PAW sig9xX40xXqHZ567b2t1ZstfXag9uAZK/PNoUhANcxAsK6Xn+DZcSlYsjmVoxqmMubvwemw MSRRmhVaav6l44nO8weww== X-UI-Out-Filterresults: notjunk:1; V01:K0:WfRSqZdSRBM=:xKyVI4T852k2M3j9ldcUhH yUDS8iJcDdVjfMefraSTMLWIcyvhod1cCdYeHDYebT9vPUDzMgndM9xJTA+HO8z/ep09D8MBI LGuSGdfjTfCT3og6Qx1p4paWSCqePGgwv2CAGAK1qTph1MfPlVorxwRb+ergl48ypygKUrBs5 d6p5KxJBlc5SP3n14GV/TKl5WHkNor5+JiNe5fcx5CGtoEccalC5z13wGvnkhMC0Yjazdg48I ESgcMJWgJ9MnfJtsU5fjo0M4GNck3o1G4CBdkvG3B//17K3FMsKCMI4+BelRz5RaM01xh6zl0 vXfBm0z3ncMpq2hrMD8xNMyRUCcORK/RABcEzp6+Lt+oW4cfL10PFfNPqn5p0J5/pV949pyA0 zXgOfyadMJYzlDjRs6thyVJeivFjMbZTbH57UP7VwXV89F7+BBIeCWRsscl5rWKgcuKxRk6RC 2xSu1pp5CxkvysfvPPuZ/GhZW9Tm5BEl61eUOVpc8xw7UXzvaXlliMzW9TIPQKSCENbtxOW/S Z4fF4bmuCoGtaRAwgqV7maUprq1poVp3OFYyLViLKSZpYzIk6h6rp2siXrxse1AfMz95PAhgA 6TW/s7sVJs+wz1rZZ4b+CHngtq6g4vEqsmVKY5MfqsOdOrofUqbbC6IULYp0+lv7CeM0lV7+B m7mpccGreOHRYp7i7t51Jdy3GCjfMoqa0a/5PPHO37NtYHhgpV3pqhnvfUW7Ue4pGgTg= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org While fixing another bug, I noticed that bcma manually sets up a dma_mask pointer for its child devices. We have a generic helper for that now, which should be able to cope better with any variations that might be needed to deal with cache coherency, unusual DMA address offsets, iommus, or limited DMA masks, none of which are currently handled here. This changes the core to use the of_dma_configure(), like we do for platform devices that are probed directly from DT. Signed-off-by: Arnd Bergmann --- This patch needs to be tested to ensure we don't introduce regressions, and should probably go into 4.7 as a cleanup. v2: fix typo drivers/bcma/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 1f635471f318..2c1798e38abd 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -209,6 +209,8 @@ static void bcma_of_fill_device(struct platform_device *parent, core->dev.of_node = node; core->irq = bcma_of_get_irq(parent, core, 0); + + of_dma_configure(&core->dev, node); } unsigned int bcma_core_irq(struct bcma_device *core, int num) @@ -248,12 +250,12 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) core->irq = bus->host_pci->irq; break; case BCMA_HOSTTYPE_SOC: - core->dev.dma_mask = &core->dev.coherent_dma_mask; - if (bus->host_pdev) { + if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { core->dma_dev = &bus->host_pdev->dev; core->dev.parent = &bus->host_pdev->dev; bcma_of_fill_device(bus->host_pdev, core); } else { + core->dev.dma_mask = &core->dev.coherent_dma_mask; core->dma_dev = &core->dev; } break;