Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecaa8b0f authored by Dave C Boutcher's avatar Dave C Boutcher Committed by Paul Mackerras
Browse files

[PATCH] powerpc: Add of_find_property function



Add an of_find_property function that returns a struct property
given a property name.  Then change the get_property function to
use that routine internally.

Signed-off-by: default avatarDave Boutcher <sleddog@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 088186de
Loading
Loading
Loading
Loading
+13 −6
Original line number Original line Diff line number Diff line
@@ -1779,11 +1779,7 @@ static int __init prom_reconfig_setup(void)
__initcall(prom_reconfig_setup);
__initcall(prom_reconfig_setup);
#endif
#endif


/*
struct property *of_find_property(struct device_node *np, const char *name,
 * Find a property with a given name for a given node
 * and return the value.
 */
unsigned char *get_property(struct device_node *np, const char *name,
				  int *lenp)
				  int *lenp)
{
{
	struct property *pp;
	struct property *pp;
@@ -1797,6 +1793,17 @@ unsigned char *get_property(struct device_node *np, const char *name,
		}
		}
	read_unlock(&devtree_lock);
	read_unlock(&devtree_lock);


	return pp;
}

/*
 * Find a property with a given name for a given node
 * and return the value.
 */
unsigned char *get_property(struct device_node *np, const char *name,
			    int *lenp)
{
	struct property *pp = of_find_property(np,name,lenp);
	return pp ? pp->value : NULL;
	return pp ? pp->value : NULL;
}
}
EXPORT_SYMBOL(get_property);
EXPORT_SYMBOL(get_property);
+3 −0
Original line number Original line Diff line number Diff line
@@ -136,6 +136,9 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node,
extern struct device_node *of_get_next_child(const struct device_node *node,
					     struct device_node *prev);
					     struct device_node *prev);
extern struct property *of_find_property(struct device_node *np,
					 const char *name,
					 int *lenp);
extern struct device_node *of_node_get(struct device_node *node);
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
extern void of_node_put(struct device_node *node);