aboutsummaryrefslogtreecommitdiff
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 14:07:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 14:07:22 -0700
commitf14121ab35912e3d2e57ac9a4ce1f9d4b7baeffb (patch)
tree7d5b4799998760e0a88166185abff1147d4ee04d /drivers/of/base.c
parent914311c9fb9bc01a215de9d848b72b5449c0e342 (diff)
parente95d8aafa5d911bf523bc47fe89f3336eb8a1b51 (diff)
Merge tag 'dt-for-3.6' of git://sources.calxeda.com/kernel/linux
Pull devicetree updates from Rob Herring: "A small set of changes for devicetree: - Couple of Documentation fixes - Addition of new helper function of_node_full_name - Improve of_parse_phandle_with_args return values - Some NULL related sparse fixes" Grant's busy packing. * tag 'dt-for-3.6' of git://sources.calxeda.com/kernel/linux: of: mtd: nuke useless const qualifier devicetree: add helper inline for retrieving a node's full name of: return -ENOENT when no property usage-model.txt: fix typo machine_init->init_machine of: Fix null pointer related warnings in base.c file LED: Fix missing semicolon in OF documentation of: fix a few typos in the binding documentation
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index a14f109dcd1..c181b94abc3 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np,
return NULL;
read_lock(&devtree_lock);
- for (pp = np->properties; pp != 0; pp = pp->next) {
+ for (pp = np->properties; pp; pp = pp->next) {
if (of_prop_cmp(pp->name, name) == 0) {
- if (lenp != 0)
+ if (lenp)
*lenp = pp->length;
break;
}
@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
- for (pp = np->properties; pp != 0; pp = pp->next) {
+ for (pp = np->properties; pp; pp = pp->next) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
of_node_get(np);
goto out;
@@ -902,7 +902,7 @@ int of_parse_phandle_with_args(struct device_node *np, const char *list_name,
/* Retrieve the phandle list property */
list = of_get_property(np, list_name, &size);
if (!list)
- return -EINVAL;
+ return -ENOENT;
list_end = list + size / sizeof(*list);
/* Loop over the phandles until all the requested entry is found */
@@ -1180,7 +1180,7 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np,
ap->stem[stem_len] = 0;
list_add_tail(&ap->link, &aliases_lookup);
pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n",
- ap->alias, ap->stem, ap->id, np ? np->full_name : NULL);
+ ap->alias, ap->stem, ap->id, of_node_full_name(np));
}
/**