From 035ebefc737cce56d3938e9b7eaa5ac0e9c28715 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 13 Jul 2010 09:42:26 +0000 Subject: of/sparc: move is_root_node() to of.h Rename is_root_node() to of_node_is_root() and make it available for all archs to use, as it's not PROM-specific. Signed-off-by: Andres Salomon Acked-by: David S. Miller Signed-off-by: Grant Likely --- arch/sparc/kernel/prom.h | 8 -------- arch/sparc/kernel/prom_64.c | 6 +++--- arch/sparc/kernel/prom_common.c | 2 +- include/linux/of.h | 5 +++++ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/arch/sparc/kernel/prom.h b/arch/sparc/kernel/prom.h index a8591ef..eeb04a7 100644 --- a/arch/sparc/kernel/prom.h +++ b/arch/sparc/kernel/prom.h @@ -9,14 +9,6 @@ extern void irq_trans_init(struct device_node *dp); extern unsigned int prom_unique_id; -static inline int is_root_node(const struct device_node *dp) -{ - if (!dp) - return 0; - - return (dp->parent == NULL); -} - extern char *build_path_component(struct device_node *dp); extern void of_console_init(void); diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index fb06ac2..0bffafd 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -81,7 +81,7 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf) return; regs = rprop->value; - if (!is_root_node(dp->parent)) { + if (!of_node_is_root(dp->parent)) { sprintf(tmp_buf, "%s@%x,%x", dp->name, (unsigned int) (regs->phys_addr >> 32UL), @@ -121,7 +121,7 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf) return; regs = prop->value; - if (!is_root_node(dp->parent)) { + if (!of_node_is_root(dp->parent)) { sprintf(tmp_buf, "%s@%x,%x", dp->name, (unsigned int) (regs->phys_addr >> 32UL), diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c index 57ac9e2..1f830da 100644 --- a/arch/sparc/kernel/prom_common.c +++ b/arch/sparc/kernel/prom_common.c @@ -244,7 +244,7 @@ char * __init build_full_name(struct device_node *dp) n = prom_early_alloc(len); strcpy(n, dp->parent->full_name); - if (!is_root_node(dp->parent)) { + if (!of_node_is_root(dp->parent)) { strcpy(n + plen, "/"); plen++; } diff --git a/include/linux/of.h b/include/linux/of.h index a367e19..b0756f3 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -70,6 +70,11 @@ extern struct device_node *allnodes; extern struct device_node *of_chosen; extern rwlock_t devtree_lock; +static inline bool of_node_is_root(const struct device_node *node) +{ + return node && (node->parent == NULL); +} + static inline int of_node_check_flag(struct device_node *n, unsigned long flag) { return test_bit(flag, &n->_flags); -- cgit v1.1