diff options
author | Olof Johansson <olof@lixom.net> | 2011-11-03 06:07:29 +0100 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2011-11-03 21:49:24 +0100 |
commit | 303f59d1a71ebf1ede04b2adb07e3f545e53b7ba (patch) | |
tree | 59891016f265b843bf465c2fb165d58d73347cd2 /drivers/of/platform.c | |
parent | Merge branch 'next/soc' of git://git.linaro.org/people/arnd/arm-soc (diff) | |
download | linux-303f59d1a71ebf1ede04b2adb07e3f545e53b7ba.tar.xz linux-303f59d1a71ebf1ede04b2adb07e3f545e53b7ba.zip |
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.c | 28 |
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 struct device_node *np) { struct resource res; - if (lookup) { - for(; lookup->name != NULL; lookup++) { - if (!of_device_is_compatible(np, lookup->compatible)) - continue; - if (of_address_to_resource(np, 0, &res)) - continue; - if (res.start != lookup->phys_addr) - continue; - pr_debug("%s: devname=%s\n", np->full_name, lookup->name); - return lookup; - } + + if (!lookup) + return NULL; + + for(; lookup->name != NULL; lookup++) { + if (!of_device_is_compatible(np, lookup->compatible)) + continue; + if (of_address_to_resource(np, 0, &res)) + continue; + if (res.start != lookup->phys_addr) + continue; + pr_debug("%s: devname=%s\n", np->full_name, lookup->name); + return lookup; } + return NULL; } @@ -329,8 +332,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l * of_platform_bus_create() - Create a device for a node and its children. * @bus: device node of the bus to instantiate * @matches: match table for bus nodes - * disallow recursive creation of child buses + * @lookup: auxdata table for matching id and platform_data with device nodes * @parent: parent for new device, or NULL for top level. + * @strict: require compatible property * * Creates a platform_device for the provided device_node, and optionally * recursively create devices for all the child nodes. |