aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 }