aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2011-11-03 01:07:29 -0400
committerRob Herring <rob.herring@calxeda.com>2011-11-03 16:49:24 -0400
commit303f59d1a71ebf1ede04b2adb07e3f545e53b7ba (patch)
tree59891016f265b843bf465c2fb165d58d73347cd2 /drivers/of/platform.c
parent994c0e992522c123298b4a91b72f5e67ba2d1123 (diff)
dt/platform: minor cleanup
* Correct description of of_platform_bus_create to match implementation * Remove a level of indentation in of_dev_lookup Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index ed5a6d3c26aa..cbd5d701c7e0 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -310,18 +310,21 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
310 struct device_node *np) 310 struct device_node *np)
311{ 311{
312 struct resource res; 312 struct resource res;
313 if (lookup) { 313
314 for(; lookup->name != NULL; lookup++) { 314 if (!lookup)
315 if (!of_device_is_compatible(np, lookup->compatible)) 315 return NULL;
316 continue; 316
317 if (of_address_to_resource(np, 0, &res)) 317 for(; lookup->name != NULL; lookup++) {
318 continue; 318 if (!of_device_is_compatible(np, lookup->compatible))
319 if (res.start != lookup->phys_addr) 319 continue;
320 continue; 320 if (of_address_to_resource(np, 0, &res))
321 pr_debug("%s: devname=%s\n", np->full_name, lookup->name); 321 continue;
322 return lookup; 322 if (res.start != lookup->phys_addr)
323 } 323 continue;
324 pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
325 return lookup;
324 } 326 }
327
325 return NULL; 328 return NULL;
326} 329}
327 330
@@ -329,8 +332,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
329 * of_platform_bus_create() - Create a device for a node and its children. 332 * of_platform_bus_create() - Create a device for a node and its children.
330 * @bus: device node of the bus to instantiate 333 * @bus: device node of the bus to instantiate
331 * @matches: match table for bus nodes 334 * @matches: match table for bus nodes
332 * disallow recursive creation of child buses 335 * @lookup: auxdata table for matching id and platform_data with device nodes
333 * @parent: parent for new device, or NULL for top level. 336 * @parent: parent for new device, or NULL for top level.
337 * @strict: require compatible property
334 * 338 *
335 * Creates a platform_device for the provided device_node, and optionally 339 * Creates a platform_device for the provided device_node, and optionally
336 * recursively create devices for all the child nodes. 340 * recursively create devices for all the child nodes.