aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-vexpress/v2m.c2
-rw-r--r--drivers/of/base.c29
-rw-r--r--drivers/of/fdt.c2
-rw-r--r--drivers/of/pdt.c12
-rw-r--r--include/linux/of.h4
5 files changed, 25 insertions, 24 deletions
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 560e0df728f8..359f782c747d 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -589,7 +589,7 @@ void __init v2m_dt_init_early(void)
589 return; 589 return;
590 590
591 /* Confirm board type against DT property, if available */ 591 /* Confirm board type against DT property, if available */
592 if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) { 592 if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) {
593 int site = v2m_get_master_site(); 593 int site = v2m_get_master_site();
594 u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ? 594 u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ?
595 V2M_SYS_PROCID1 : V2M_SYS_PROCID0)); 595 V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
diff --git a/drivers/of/base.c b/drivers/of/base.c
index c3724110a288..538e3cfad23e 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -45,7 +45,8 @@ struct alias_prop {
45 45
46static LIST_HEAD(aliases_lookup); 46static LIST_HEAD(aliases_lookup);
47 47
48struct device_node *allnodes; 48struct device_node *of_allnodes;
49EXPORT_SYMBOL(of_allnodes);
49struct device_node *of_chosen; 50struct device_node *of_chosen;
50struct device_node *of_aliases; 51struct device_node *of_aliases;
51 52
@@ -199,7 +200,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
199 struct device_node *np; 200 struct device_node *np;
200 201
201 read_lock(&devtree_lock); 202 read_lock(&devtree_lock);
202 np = prev ? prev->allnext : allnodes; 203 np = prev ? prev->allnext : of_allnodes;
203 for (; np != NULL; np = np->allnext) 204 for (; np != NULL; np = np->allnext)
204 if (of_node_get(np)) 205 if (of_node_get(np))
205 break; 206 break;
@@ -422,7 +423,7 @@ EXPORT_SYMBOL(of_get_child_by_name);
422 */ 423 */
423struct device_node *of_find_node_by_path(const char *path) 424struct device_node *of_find_node_by_path(const char *path)
424{ 425{
425 struct device_node *np = allnodes; 426 struct device_node *np = of_allnodes;
426 427
427 read_lock(&devtree_lock); 428 read_lock(&devtree_lock);
428 for (; np; np = np->allnext) { 429 for (; np; np = np->allnext) {
@@ -452,7 +453,7 @@ struct device_node *of_find_node_by_name(struct device_node *from,
452 struct device_node *np; 453 struct device_node *np;
453 454
454 read_lock(&devtree_lock); 455 read_lock(&devtree_lock);
455 np = from ? from->allnext : allnodes; 456 np = from ? from->allnext : of_allnodes;
456 for (; np; np = np->allnext) 457 for (; np; np = np->allnext)
457 if (np->name && (of_node_cmp(np->name, name) == 0) 458 if (np->name && (of_node_cmp(np->name, name) == 0)
458 && of_node_get(np)) 459 && of_node_get(np))
@@ -481,7 +482,7 @@ struct device_node *of_find_node_by_type(struct device_node *from,
481 struct device_node *np; 482 struct device_node *np;
482 483
483 read_lock(&devtree_lock); 484 read_lock(&devtree_lock);
484 np = from ? from->allnext : allnodes; 485 np = from ? from->allnext : of_allnodes;
485 for (; np; np = np->allnext) 486 for (; np; np = np->allnext)
486 if (np->type && (of_node_cmp(np->type, type) == 0) 487 if (np->type && (of_node_cmp(np->type, type) == 0)
487 && of_node_get(np)) 488 && of_node_get(np))
@@ -512,7 +513,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
512 struct device_node *np; 513 struct device_node *np;
513 514
514 read_lock(&devtree_lock); 515 read_lock(&devtree_lock);
515 np = from ? from->allnext : allnodes; 516 np = from ? from->allnext : of_allnodes;
516 for (; np; np = np->allnext) { 517 for (; np; np = np->allnext) {
517 if (type 518 if (type
518 && !(np->type && (of_node_cmp(np->type, type) == 0))) 519 && !(np->type && (of_node_cmp(np->type, type) == 0)))
@@ -545,7 +546,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
545 struct property *pp; 546 struct property *pp;
546 547
547 read_lock(&devtree_lock); 548 read_lock(&devtree_lock);
548 np = from ? from->allnext : allnodes; 549 np = from ? from->allnext : of_allnodes;
549 for (; np; np = np->allnext) { 550 for (; np; np = np->allnext) {
550 for (pp = np->properties; pp; pp = pp->next) { 551 for (pp = np->properties; pp; pp = pp->next) {
551 if (of_prop_cmp(pp->name, prop_name) == 0) { 552 if (of_prop_cmp(pp->name, prop_name) == 0) {
@@ -616,7 +617,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
616 *match = NULL; 617 *match = NULL;
617 618
618 read_lock(&devtree_lock); 619 read_lock(&devtree_lock);
619 np = from ? from->allnext : allnodes; 620 np = from ? from->allnext : of_allnodes;
620 for (; np; np = np->allnext) { 621 for (; np; np = np->allnext) {
621 if (of_match_node(matches, np) && of_node_get(np)) { 622 if (of_match_node(matches, np) && of_node_get(np)) {
622 if (match) 623 if (match)
@@ -669,7 +670,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
669 struct device_node *np; 670 struct device_node *np;
670 671
671 read_lock(&devtree_lock); 672 read_lock(&devtree_lock);
672 for (np = allnodes; np; np = np->allnext) 673 for (np = of_allnodes; np; np = np->allnext)
673 if (np->phandle == handle) 674 if (np->phandle == handle)
674 break; 675 break;
675 of_node_get(np); 676 of_node_get(np);
@@ -1254,9 +1255,9 @@ void of_attach_node(struct device_node *np)
1254 1255
1255 write_lock_irqsave(&devtree_lock, flags); 1256 write_lock_irqsave(&devtree_lock, flags);
1256 np->sibling = np->parent->child; 1257 np->sibling = np->parent->child;
1257 np->allnext = allnodes; 1258 np->allnext = of_allnodes;
1258 np->parent->child = np; 1259 np->parent->child = np;
1259 allnodes = np; 1260 of_allnodes = np;
1260 write_unlock_irqrestore(&devtree_lock, flags); 1261 write_unlock_irqrestore(&devtree_lock, flags);
1261} 1262}
1262 1263
@@ -1277,11 +1278,11 @@ void of_detach_node(struct device_node *np)
1277 if (!parent) 1278 if (!parent)
1278 goto out_unlock; 1279 goto out_unlock;
1279 1280
1280 if (allnodes == np) 1281 if (of_allnodes == np)
1281 allnodes = np->allnext; 1282 of_allnodes = np->allnext;
1282 else { 1283 else {
1283 struct device_node *prev; 1284 struct device_node *prev;
1284 for (prev = allnodes; 1285 for (prev = of_allnodes;
1285 prev->allnext != np; 1286 prev->allnext != np;
1286 prev = prev->allnext) 1287 prev = prev->allnext)
1287 ; 1288 ;
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index e36ff40011f4..a65c39c473bf 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -712,7 +712,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
712 */ 712 */
713void __init unflatten_device_tree(void) 713void __init unflatten_device_tree(void)
714{ 714{
715 __unflatten_device_tree(initial_boot_params, &allnodes, 715 __unflatten_device_tree(initial_boot_params, &of_allnodes,
716 early_init_dt_alloc_memory_arch); 716 early_init_dt_alloc_memory_arch);
717 717
718 /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ 718 /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c
index 07cc1d678e4d..37b56fd716e6 100644
--- a/drivers/of/pdt.c
+++ b/drivers/of/pdt.c
@@ -241,15 +241,15 @@ void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
241 BUG_ON(!ops); 241 BUG_ON(!ops);
242 of_pdt_prom_ops = ops; 242 of_pdt_prom_ops = ops;
243 243
244 allnodes = of_pdt_create_node(root_node, NULL); 244 of_allnodes = of_pdt_create_node(root_node, NULL);
245#if defined(CONFIG_SPARC) 245#if defined(CONFIG_SPARC)
246 allnodes->path_component_name = ""; 246 of_allnodes->path_component_name = "";
247#endif 247#endif
248 allnodes->full_name = "/"; 248 of_allnodes->full_name = "/";
249 249
250 nextp = &allnodes->allnext; 250 nextp = &of_allnodes->allnext;
251 allnodes->child = of_pdt_build_tree(allnodes, 251 of_allnodes->child = of_pdt_build_tree(of_allnodes,
252 of_pdt_prom_ops->getchild(allnodes->phandle), &nextp); 252 of_pdt_prom_ops->getchild(of_allnodes->phandle), &nextp);
253 253
254 /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ 254 /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
255 of_alias_scan(kernel_tree_alloc); 255 of_alias_scan(kernel_tree_alloc);
diff --git a/include/linux/of.h b/include/linux/of.h
index 7337dc109c89..60053bd7e79a 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
88#ifdef CONFIG_OF 88#ifdef CONFIG_OF
89 89
90/* Pointer for first entry in chain of all nodes. */ 90/* Pointer for first entry in chain of all nodes. */
91extern struct device_node *allnodes; 91extern struct device_node *of_allnodes;
92extern struct device_node *of_chosen; 92extern struct device_node *of_chosen;
93extern struct device_node *of_aliases; 93extern struct device_node *of_aliases;
94extern rwlock_t devtree_lock; 94extern rwlock_t devtree_lock;
95 95
96static inline bool of_have_populated_dt(void) 96static inline bool of_have_populated_dt(void)
97{ 97{
98 return allnodes != NULL; 98 return of_allnodes != NULL;
99} 99}
100 100
101static inline bool of_node_is_root(const struct device_node *node) 101static inline bool of_node_is_root(const struct device_node *node)