diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2012-11-30 05:01:51 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-11-30 05:04:06 -0500 |
commit | 465aac6d496aa3e99caaa6868865fb3830f73d80 (patch) | |
tree | 105ef4075b2f2f351aafb6d87ee69d60b3c1e751 /drivers/of | |
parent | f3b6159e6a12136ac9c59aaa92ba9f3e484df650 (diff) |
Fix build when CONFIG_W1_MASTER_GPIO=m b exporting "allnodes"
ERROR: "allnodes" [drivers/w1/masters/w1-gpio.ko] undefined!
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
[grant.likely: allnodes is too generic; rename to of_allnodes]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Ville Syrjala <syrjala@sci.fi>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 29 | ||||
-rw-r--r-- | drivers/of/fdt.c | 2 | ||||
-rw-r--r-- | drivers/of/pdt.c | 12 |
3 files changed, 22 insertions, 21 deletions
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 | ||
46 | static LIST_HEAD(aliases_lookup); | 46 | static LIST_HEAD(aliases_lookup); |
47 | 47 | ||
48 | struct device_node *allnodes; | 48 | struct device_node *of_allnodes; |
49 | EXPORT_SYMBOL(of_allnodes); | ||
49 | struct device_node *of_chosen; | 50 | struct device_node *of_chosen; |
50 | struct device_node *of_aliases; | 51 | struct 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 | */ |
423 | struct device_node *of_find_node_by_path(const char *path) | 424 | struct 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 | */ |
713 | void __init unflatten_device_tree(void) | 713 | void __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); |