aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRobin Murphy <Robin.Murphy@arm.com>2014-09-17 07:56:07 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2014-09-22 06:26:59 -0400
commitc9d571bee9628bc925253a21ea5943707aadb5f1 (patch)
treef48940ab42be9bdef51fc07c113ae145d3af9dc1 /drivers/of
parent668ebd106860f09f43993517f786a2ddfd0f9ebe (diff)
of: amba: use of_dma_configure for AMBA devices
Commit 591c1e ("of: configure the platform device dma parameters) introduced a common mechanism to configure DMA from DT properties. AMBA devices created from DT can take advantage of this, too. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/platform.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 0197725e033a..3b64d0bf5bba 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -160,11 +160,10 @@ EXPORT_SYMBOL(of_device_alloc);
160 * can use Platform bus notifier and handle BUS_NOTIFY_ADD_DEVICE event 160 * can use Platform bus notifier and handle BUS_NOTIFY_ADD_DEVICE event
161 * to fix up DMA configuration. 161 * to fix up DMA configuration.
162 */ 162 */
163static void of_dma_configure(struct platform_device *pdev) 163static void of_dma_configure(struct device *dev)
164{ 164{
165 u64 dma_addr, paddr, size; 165 u64 dma_addr, paddr, size;
166 int ret; 166 int ret;
167 struct device *dev = &pdev->dev;
168 167
169 /* 168 /*
170 * Set default dma-mask to 32 bit. Drivers are expected to setup 169 * Set default dma-mask to 32 bit. Drivers are expected to setup
@@ -229,7 +228,7 @@ static struct platform_device *of_platform_device_create_pdata(
229 if (!dev) 228 if (!dev)
230 goto err_clear_flag; 229 goto err_clear_flag;
231 230
232 of_dma_configure(dev); 231 of_dma_configure(&dev->dev);
233 dev->dev.bus = &platform_bus_type; 232 dev->dev.bus = &platform_bus_type;
234 dev->dev.platform_data = platform_data; 233 dev->dev.platform_data = platform_data;
235 234
@@ -291,7 +290,6 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
291 } 290 }
292 291
293 /* setup generic device info */ 292 /* setup generic device info */
294 dev->dev.coherent_dma_mask = ~0;
295 dev->dev.of_node = of_node_get(node); 293 dev->dev.of_node = of_node_get(node);
296 dev->dev.parent = parent; 294 dev->dev.parent = parent;
297 dev->dev.platform_data = platform_data; 295 dev->dev.platform_data = platform_data;
@@ -299,6 +297,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
299 dev_set_name(&dev->dev, "%s", bus_id); 297 dev_set_name(&dev->dev, "%s", bus_id);
300 else 298 else
301 of_device_make_bus_id(&dev->dev); 299 of_device_make_bus_id(&dev->dev);
300 of_dma_configure(&dev->dev);
302 301
303 /* Allow the HW Peripheral ID to be overridden */ 302 /* Allow the HW Peripheral ID to be overridden */
304 prop = of_get_property(node, "arm,primecell-periphid", NULL); 303 prop = of_get_property(node, "arm,primecell-periphid", NULL);