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>
This commit is contained in:
		
					parent
					
						
							
								f3b6159e6a
							
						
					
				
			
			
				commit
				
					
						465aac6d49
					
				
			
		
					 5 changed files with 25 additions and 24 deletions
				
			
		| 
						 | 
					@ -589,7 +589,7 @@ void __init v2m_dt_init_early(void)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Confirm board type against DT property, if available */
 | 
						/* Confirm board type against DT property, if available */
 | 
				
			||||||
	if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
 | 
						if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) {
 | 
				
			||||||
		int site = v2m_get_master_site();
 | 
							int site = v2m_get_master_site();
 | 
				
			||||||
		u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ?
 | 
							u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ?
 | 
				
			||||||
				V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
 | 
									V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,8 @@ struct alias_prop {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static LIST_HEAD(aliases_lookup);
 | 
					static LIST_HEAD(aliases_lookup);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct device_node *allnodes;
 | 
					struct device_node *of_allnodes;
 | 
				
			||||||
 | 
					EXPORT_SYMBOL(of_allnodes);
 | 
				
			||||||
struct device_node *of_chosen;
 | 
					struct device_node *of_chosen;
 | 
				
			||||||
struct device_node *of_aliases;
 | 
					struct device_node *of_aliases;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -199,7 +200,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
 | 
				
			||||||
	struct device_node *np;
 | 
						struct device_node *np;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = prev ? prev->allnext : allnodes;
 | 
						np = prev ? prev->allnext : of_allnodes;
 | 
				
			||||||
	for (; np != NULL; np = np->allnext)
 | 
						for (; np != NULL; np = np->allnext)
 | 
				
			||||||
		if (of_node_get(np))
 | 
							if (of_node_get(np))
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					@ -422,7 +423,7 @@ EXPORT_SYMBOL(of_get_child_by_name);
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
struct device_node *of_find_node_by_path(const char *path)
 | 
					struct device_node *of_find_node_by_path(const char *path)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct device_node *np = allnodes;
 | 
						struct device_node *np = of_allnodes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	for (; np; np = np->allnext) {
 | 
						for (; np; np = np->allnext) {
 | 
				
			||||||
| 
						 | 
					@ -452,7 +453,7 @@ struct device_node *of_find_node_by_name(struct device_node *from,
 | 
				
			||||||
	struct device_node *np;
 | 
						struct device_node *np;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = from ? from->allnext : allnodes;
 | 
						np = from ? from->allnext : of_allnodes;
 | 
				
			||||||
	for (; np; np = np->allnext)
 | 
						for (; np; np = np->allnext)
 | 
				
			||||||
		if (np->name && (of_node_cmp(np->name, name) == 0)
 | 
							if (np->name && (of_node_cmp(np->name, name) == 0)
 | 
				
			||||||
		    && of_node_get(np))
 | 
							    && of_node_get(np))
 | 
				
			||||||
| 
						 | 
					@ -481,7 +482,7 @@ struct device_node *of_find_node_by_type(struct device_node *from,
 | 
				
			||||||
	struct device_node *np;
 | 
						struct device_node *np;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = from ? from->allnext : allnodes;
 | 
						np = from ? from->allnext : of_allnodes;
 | 
				
			||||||
	for (; np; np = np->allnext)
 | 
						for (; np; np = np->allnext)
 | 
				
			||||||
		if (np->type && (of_node_cmp(np->type, type) == 0)
 | 
							if (np->type && (of_node_cmp(np->type, type) == 0)
 | 
				
			||||||
		    && of_node_get(np))
 | 
							    && of_node_get(np))
 | 
				
			||||||
| 
						 | 
					@ -512,7 +513,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
 | 
				
			||||||
	struct device_node *np;
 | 
						struct device_node *np;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = from ? from->allnext : allnodes;
 | 
						np = from ? from->allnext : of_allnodes;
 | 
				
			||||||
	for (; np; np = np->allnext) {
 | 
						for (; np; np = np->allnext) {
 | 
				
			||||||
		if (type
 | 
							if (type
 | 
				
			||||||
		    && !(np->type && (of_node_cmp(np->type, type) == 0)))
 | 
							    && !(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,
 | 
				
			||||||
	struct property *pp;
 | 
						struct property *pp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = from ? from->allnext : allnodes;
 | 
						np = from ? from->allnext : of_allnodes;
 | 
				
			||||||
	for (; np; np = np->allnext) {
 | 
						for (; np; np = np->allnext) {
 | 
				
			||||||
		for (pp = np->properties; pp; pp = pp->next) {
 | 
							for (pp = np->properties; pp; pp = pp->next) {
 | 
				
			||||||
			if (of_prop_cmp(pp->name, prop_name) == 0) {
 | 
								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,
 | 
				
			||||||
		*match = NULL;
 | 
							*match = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	np = from ? from->allnext : allnodes;
 | 
						np = from ? from->allnext : of_allnodes;
 | 
				
			||||||
	for (; np; np = np->allnext) {
 | 
						for (; np; np = np->allnext) {
 | 
				
			||||||
		if (of_match_node(matches, np) && of_node_get(np)) {
 | 
							if (of_match_node(matches, np) && of_node_get(np)) {
 | 
				
			||||||
			if (match)
 | 
								if (match)
 | 
				
			||||||
| 
						 | 
					@ -669,7 +670,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
 | 
				
			||||||
	struct device_node *np;
 | 
						struct device_node *np;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_lock(&devtree_lock);
 | 
						read_lock(&devtree_lock);
 | 
				
			||||||
	for (np = allnodes; np; np = np->allnext)
 | 
						for (np = of_allnodes; np; np = np->allnext)
 | 
				
			||||||
		if (np->phandle == handle)
 | 
							if (np->phandle == handle)
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
	of_node_get(np);
 | 
						of_node_get(np);
 | 
				
			||||||
| 
						 | 
					@ -1254,9 +1255,9 @@ void of_attach_node(struct device_node *np)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	write_lock_irqsave(&devtree_lock, flags);
 | 
						write_lock_irqsave(&devtree_lock, flags);
 | 
				
			||||||
	np->sibling = np->parent->child;
 | 
						np->sibling = np->parent->child;
 | 
				
			||||||
	np->allnext = allnodes;
 | 
						np->allnext = of_allnodes;
 | 
				
			||||||
	np->parent->child = np;
 | 
						np->parent->child = np;
 | 
				
			||||||
	allnodes = np;
 | 
						of_allnodes = np;
 | 
				
			||||||
	write_unlock_irqrestore(&devtree_lock, flags);
 | 
						write_unlock_irqrestore(&devtree_lock, flags);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1277,11 +1278,11 @@ void of_detach_node(struct device_node *np)
 | 
				
			||||||
	if (!parent)
 | 
						if (!parent)
 | 
				
			||||||
		goto out_unlock;
 | 
							goto out_unlock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (allnodes == np)
 | 
						if (of_allnodes == np)
 | 
				
			||||||
		allnodes = np->allnext;
 | 
							of_allnodes = np->allnext;
 | 
				
			||||||
	else {
 | 
						else {
 | 
				
			||||||
		struct device_node *prev;
 | 
							struct device_node *prev;
 | 
				
			||||||
		for (prev = allnodes;
 | 
							for (prev = of_allnodes;
 | 
				
			||||||
		     prev->allnext != np;
 | 
							     prev->allnext != np;
 | 
				
			||||||
		     prev = prev->allnext)
 | 
							     prev = prev->allnext)
 | 
				
			||||||
			;
 | 
								;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -712,7 +712,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void __init unflatten_device_tree(void)
 | 
					void __init unflatten_device_tree(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	__unflatten_device_tree(initial_boot_params, &allnodes,
 | 
						__unflatten_device_tree(initial_boot_params, &of_allnodes,
 | 
				
			||||||
				early_init_dt_alloc_memory_arch);
 | 
									early_init_dt_alloc_memory_arch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
 | 
						/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -241,15 +241,15 @@ void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
 | 
				
			||||||
	BUG_ON(!ops);
 | 
						BUG_ON(!ops);
 | 
				
			||||||
	of_pdt_prom_ops = ops;
 | 
						of_pdt_prom_ops = ops;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	allnodes = of_pdt_create_node(root_node, NULL);
 | 
						of_allnodes = of_pdt_create_node(root_node, NULL);
 | 
				
			||||||
#if defined(CONFIG_SPARC)
 | 
					#if defined(CONFIG_SPARC)
 | 
				
			||||||
	allnodes->path_component_name = "";
 | 
						of_allnodes->path_component_name = "";
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	allnodes->full_name = "/";
 | 
						of_allnodes->full_name = "/";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nextp = &allnodes->allnext;
 | 
						nextp = &of_allnodes->allnext;
 | 
				
			||||||
	allnodes->child = of_pdt_build_tree(allnodes,
 | 
						of_allnodes->child = of_pdt_build_tree(of_allnodes,
 | 
				
			||||||
			of_pdt_prom_ops->getchild(allnodes->phandle), &nextp);
 | 
								of_pdt_prom_ops->getchild(of_allnodes->phandle), &nextp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
 | 
						/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
 | 
				
			||||||
	of_alias_scan(kernel_tree_alloc);
 | 
						of_alias_scan(kernel_tree_alloc);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
 | 
				
			||||||
#ifdef CONFIG_OF
 | 
					#ifdef CONFIG_OF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Pointer for first entry in chain of all nodes. */
 | 
					/* Pointer for first entry in chain of all nodes. */
 | 
				
			||||||
extern struct device_node *allnodes;
 | 
					extern struct device_node *of_allnodes;
 | 
				
			||||||
extern struct device_node *of_chosen;
 | 
					extern struct device_node *of_chosen;
 | 
				
			||||||
extern struct device_node *of_aliases;
 | 
					extern struct device_node *of_aliases;
 | 
				
			||||||
extern rwlock_t devtree_lock;
 | 
					extern rwlock_t devtree_lock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline bool of_have_populated_dt(void)
 | 
					static inline bool of_have_populated_dt(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return allnodes != NULL;
 | 
						return of_allnodes != NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline bool of_node_is_root(const struct device_node *node)
 | 
					static inline bool of_node_is_root(const struct device_node *node)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue