aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:53:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:53:52 -0400
commit31f7c3a688f75bceaf2fd009efc489659ad6aa61 (patch)
tree1721765e553c01559d1b784563d4840c5d3dd0b9 /drivers/of/platform.c
parentec5b103ecfde929004b691f29183255aeeadecd5 (diff)
parent2bc552df76d83cf1455ac8cf4c87615bfd15df74 (diff)
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull device tree core updates from Grant Likely: "Generally minor changes. A bunch of bug fixes, particularly for initialization and some refactoring. Most notable change if feeding the entire flattened tree into the random pool at boot. May not be significant, but shouldn't hurt either" Tim Bird questions whether the boot time cost of the random feeding may be noticeable. And "add_device_randomness()" is definitely not some speed deamon of a function. * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux: of/platform: add error reporting to of_amba_device_create() irq/of: Fix comment typo for irq_of_parse_and_map of: Feed entire flattened device tree into the random pool of/fdt: Clean up casting in unflattening path of/fdt: Remove duplicate memory clearing on FDT unflattening gpio: implement gpio-ranges binding document fix of: call __of_parse_phandle_with_args from of_parse_phandle of: introduce of_parse_phandle_with_fixed_args of: move of_parse_phandle() of: move documentation of of_parse_phandle_with_args of: Fix missing memory initialization on FDT unflattening of: consolidate definition of early_init_dt_alloc_memory_arch() of: Make of_get_phy_mode() return int i.s.o. const int include: dt-binding: input: create a DT header defining key codes. of/platform: Staticize of_platform_device_create_pdata() of: Specify initrd location using 64-bit dt: Typo fix OF: make of_property_for_each_{u32|string}() use parameters if OF is not enabled
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index eeca8a596973..9b439ac63d8e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -197,7 +197,7 @@ EXPORT_SYMBOL(of_device_alloc);
197 * Returns pointer to created platform device, or NULL if a device was not 197 * Returns pointer to created platform device, or NULL if a device was not
198 * registered. Unavailable devices will not get registered. 198 * registered. Unavailable devices will not get registered.
199 */ 199 */
200struct platform_device *of_platform_device_create_pdata( 200static struct platform_device *of_platform_device_create_pdata(
201 struct device_node *np, 201 struct device_node *np,
202 const char *bus_id, 202 const char *bus_id,
203 void *platform_data, 203 void *platform_data,
@@ -268,8 +268,11 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
268 return NULL; 268 return NULL;
269 269
270 dev = amba_device_alloc(NULL, 0, 0); 270 dev = amba_device_alloc(NULL, 0, 0);
271 if (!dev) 271 if (!dev) {
272 pr_err("%s(): amba_device_alloc() failed for %s\n",
273 __func__, node->full_name);
272 return NULL; 274 return NULL;
275 }
273 276
274 /* setup generic device info */ 277 /* setup generic device info */
275 dev->dev.coherent_dma_mask = ~0; 278 dev->dev.coherent_dma_mask = ~0;
@@ -294,12 +297,18 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
294 dev->irq[i] = irq_of_parse_and_map(node, i); 297 dev->irq[i] = irq_of_parse_and_map(node, i);
295 298
296 ret = of_address_to_resource(node, 0, &dev->res); 299 ret = of_address_to_resource(node, 0, &dev->res);
297 if (ret) 300 if (ret) {
301 pr_err("%s(): of_address_to_resource() failed (%d) for %s\n",
302 __func__, ret, node->full_name);
298 goto err_free; 303 goto err_free;
304 }
299 305
300 ret = amba_device_add(dev, &iomem_resource); 306 ret = amba_device_add(dev, &iomem_resource);
301 if (ret) 307 if (ret) {
308 pr_err("%s(): amba_device_add() failed (%d) for %s\n",
309 __func__, ret, node->full_name);
302 goto err_free; 310 goto err_free;
311 }
303 312
304 return dev; 313 return dev;
305 314
@@ -378,6 +387,10 @@ static int of_platform_bus_create(struct device_node *bus,
378 } 387 }
379 388
380 if (of_device_is_compatible(bus, "arm,primecell")) { 389 if (of_device_is_compatible(bus, "arm,primecell")) {
390 /*
391 * Don't return an error here to keep compatibility with older
392 * device tree files.
393 */
381 of_amba_device_create(bus, bus_id, platform_data, parent); 394 of_amba_device_create(bus, bus_id, platform_data, parent);
382 return 0; 395 return 0;
383 } 396 }