diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-06-15 13:50:25 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-07-06 08:16:34 -0400 |
commit | 74a7f08448adea6cb47cd9b260c98ff168117e92 (patch) | |
tree | df2ce1ae517e390d1049e01c1428a4b31fd689cc /drivers/of | |
parent | 1af4c7f18a442771d86d496c761e9816349f98c9 (diff) |
devicetree: add helper inline for retrieving a node's full name
The pattern (np ? np->full_name : "<none>") is rather common in the
kernel, but can also make for quite long lines. This patch adds a new
inline function, of_node_full_name() so that the test for a valid node
pointer doesn't need to be open coded at all call sites.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 2 | ||||
-rw-r--r-- | drivers/of/irq.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 85757952f12d..9ec0a2f1b028 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -1173,7 +1173,7 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np, | |||
1173 | ap->stem[stem_len] = 0; | 1173 | ap->stem[stem_len] = 0; |
1174 | list_add_tail(&ap->link, &aliases_lookup); | 1174 | list_add_tail(&ap->link, &aliases_lookup); |
1175 | pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n", | 1175 | pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n", |
1176 | ap->alias, ap->stem, ap->id, np ? np->full_name : NULL); | 1176 | ap->alias, ap->stem, ap->id, of_node_full_name(np)); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | /** | 1179 | /** |
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 9cf00602f566..ff8ab7b27373 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
@@ -255,7 +255,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, | |||
255 | 255 | ||
256 | skiplevel: | 256 | skiplevel: |
257 | /* Iterate again with new parent */ | 257 | /* Iterate again with new parent */ |
258 | pr_debug(" -> new parent: %s\n", newpar ? newpar->full_name : "<>"); | 258 | pr_debug(" -> new parent: %s\n", of_node_full_name(newpar)); |
259 | of_node_put(ipar); | 259 | of_node_put(ipar); |
260 | ipar = newpar; | 260 | ipar = newpar; |
261 | newpar = NULL; | 261 | newpar = NULL; |