aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2013-08-30 07:17:29 -0400
committerGrant Likely <grant.likely@linaro.org>2013-09-09 12:04:52 -0400
commit2bc552df76d83cf1455ac8cf4c87615bfd15df74 (patch)
tree07999788612ad5e4435594ae8725bafdb6c39a9f /drivers/of
parentd84ff46a9e19fe27ac6e4d7740ca0429c28e778a (diff)
of/platform: add error reporting to of_amba_device_create()
Add error reporting to of_amba_device_create() so the user knows when (and why) some device tree nodes fail to initialize. [ The issue was spotted on Universal C210 board (using revision 0 of ARM Exynos4210 SoC) on which initialization was silently failing for PL330 MDMA1 device tree node (it was using the wrong addres resulting in amba_device_add() returning -ENODEV). ] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/platform.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b0d1ff8b0991..f6dcde220821 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -264,8 +264,11 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
264 return NULL; 264 return NULL;
265 265
266 dev = amba_device_alloc(NULL, 0, 0); 266 dev = amba_device_alloc(NULL, 0, 0);
267 if (!dev) 267 if (!dev) {
268 pr_err("%s(): amba_device_alloc() failed for %s\n",
269 __func__, node->full_name);
268 return NULL; 270 return NULL;
271 }
269 272
270 /* setup generic device info */ 273 /* setup generic device info */
271 dev->dev.coherent_dma_mask = ~0; 274 dev->dev.coherent_dma_mask = ~0;
@@ -290,12 +293,18 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
290 dev->irq[i] = irq_of_parse_and_map(node, i); 293 dev->irq[i] = irq_of_parse_and_map(node, i);
291 294
292 ret = of_address_to_resource(node, 0, &dev->res); 295 ret = of_address_to_resource(node, 0, &dev->res);
293 if (ret) 296 if (ret) {
297 pr_err("%s(): of_address_to_resource() failed (%d) for %s\n",
298 __func__, ret, node->full_name);
294 goto err_free; 299 goto err_free;
300 }
295 301
296 ret = amba_device_add(dev, &iomem_resource); 302 ret = amba_device_add(dev, &iomem_resource);
297 if (ret) 303 if (ret) {
304 pr_err("%s(): amba_device_add() failed (%d) for %s\n",
305 __func__, ret, node->full_name);
298 goto err_free; 306 goto err_free;
307 }
299 308
300 return dev; 309 return dev;
301 310
@@ -374,6 +383,10 @@ static int of_platform_bus_create(struct device_node *bus,
374 } 383 }
375 384
376 if (of_device_is_compatible(bus, "arm,primecell")) { 385 if (of_device_is_compatible(bus, "arm,primecell")) {
386 /*
387 * Don't return an error here to keep compatibility with older
388 * device tree files.
389 */
377 of_amba_device_create(bus, bus_id, platform_data, parent); 390 of_amba_device_create(bus, bus_id, platform_data, parent);
378 return 0; 391 return 0;
379 } 392 }