summaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-03-17 05:39:17 -0400
committerKalle Valo <kvalo@codeaurora.org>2016-09-09 05:00:37 -0400
commitdefb893fffef89ac6db4e68fccae1783d7c93977 (patch)
tree7ec2e9f94a47d9c6ce5304e7b2a5fb36d9e4eed9 /drivers/bcma
parent5856cd5b8dda5ee013a2b0abbab0552a6f14d72d (diff)
bcma: use of_dma_configure() to set initial dma mask
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 <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/main.c6
1 files changed, 4 insertions, 2 deletions
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,
209 core->dev.of_node = node; 209 core->dev.of_node = node;
210 210
211 core->irq = bcma_of_get_irq(parent, core, 0); 211 core->irq = bcma_of_get_irq(parent, core, 0);
212
213 of_dma_configure(&core->dev, node);
212} 214}
213 215
214unsigned int bcma_core_irq(struct bcma_device *core, int num) 216unsigned 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)
248 core->irq = bus->host_pci->irq; 250 core->irq = bus->host_pci->irq;
249 break; 251 break;
250 case BCMA_HOSTTYPE_SOC: 252 case BCMA_HOSTTYPE_SOC:
251 core->dev.dma_mask = &core->dev.coherent_dma_mask; 253 if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
252 if (bus->host_pdev) {
253 core->dma_dev = &bus->host_pdev->dev; 254 core->dma_dev = &bus->host_pdev->dev;
254 core->dev.parent = &bus->host_pdev->dev; 255 core->dev.parent = &bus->host_pdev->dev;
255 bcma_of_fill_device(bus->host_pdev, core); 256 bcma_of_fill_device(bus->host_pdev, core);
256 } else { 257 } else {
258 core->dev.dma_mask = &core->dev.coherent_dma_mask;
257 core->dma_dev = &core->dev; 259 core->dma_dev = &core->dev;
258 } 260 }
259 break; 261 break;