mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
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 <dilinger@queued.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
parent
ef2a4524d6
commit
035ebefc73
4 changed files with 9 additions and 12 deletions
|
@ -9,14 +9,6 @@ extern void irq_trans_init(struct device_node *dp);
|
||||||
|
|
||||||
extern unsigned int prom_unique_id;
|
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 char *build_path_component(struct device_node *dp);
|
||||||
extern void of_console_init(void);
|
extern void of_console_init(void);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/lmb.h>
|
#include <linux/lmb.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of.h>
|
||||||
|
|
||||||
#include <asm/prom.h>
|
#include <asm/prom.h>
|
||||||
#include <asm/oplib.h>
|
#include <asm/oplib.h>
|
||||||
|
@ -81,7 +81,7 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
regs = rprop->value;
|
regs = rprop->value;
|
||||||
if (!is_root_node(dp->parent)) {
|
if (!of_node_is_root(dp->parent)) {
|
||||||
sprintf(tmp_buf, "%s@%x,%x",
|
sprintf(tmp_buf, "%s@%x,%x",
|
||||||
dp->name,
|
dp->name,
|
||||||
(unsigned int) (regs->phys_addr >> 32UL),
|
(unsigned int) (regs->phys_addr >> 32UL),
|
||||||
|
@ -121,7 +121,7 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
regs = prop->value;
|
regs = prop->value;
|
||||||
if (!is_root_node(dp->parent)) {
|
if (!of_node_is_root(dp->parent)) {
|
||||||
sprintf(tmp_buf, "%s@%x,%x",
|
sprintf(tmp_buf, "%s@%x,%x",
|
||||||
dp->name,
|
dp->name,
|
||||||
(unsigned int) (regs->phys_addr >> 32UL),
|
(unsigned int) (regs->phys_addr >> 32UL),
|
||||||
|
|
|
@ -244,7 +244,7 @@ char * __init build_full_name(struct device_node *dp)
|
||||||
|
|
||||||
n = prom_early_alloc(len);
|
n = prom_early_alloc(len);
|
||||||
strcpy(n, dp->parent->full_name);
|
strcpy(n, dp->parent->full_name);
|
||||||
if (!is_root_node(dp->parent)) {
|
if (!of_node_is_root(dp->parent)) {
|
||||||
strcpy(n + plen, "/");
|
strcpy(n + plen, "/");
|
||||||
plen++;
|
plen++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,11 @@ extern struct device_node *allnodes;
|
||||||
extern struct device_node *of_chosen;
|
extern struct device_node *of_chosen;
|
||||||
extern rwlock_t devtree_lock;
|
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)
|
static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
|
||||||
{
|
{
|
||||||
return test_bit(flag, &n->_flags);
|
return test_bit(flag, &n->_flags);
|
||||||
|
|
Loading…
Reference in a new issue