From: Dave C Boutcher Date: Thu, 12 Jan 2006 22:09:29 +0000 (-0600) Subject: [PATCH] powerpc: Add of_find_property function X-Git-Tag: MMI-PSA29.97-13-9~52899^2~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ecaa8b0ff326920c8a89d748382e1c1d8812676c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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: Dave Boutcher Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 70057b63de21..d50c8df0183e 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -1779,12 +1779,8 @@ static int __init prom_reconfig_setup(void) __initcall(prom_reconfig_setup); #endif -/* - * 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 *of_find_property(struct device_node *np, const char *name, + int *lenp) { struct property *pp; @@ -1797,6 +1793,17 @@ unsigned char *get_property(struct device_node *np, const char *name, } 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; } EXPORT_SYMBOL(get_property); diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 25d8d5974d19..5b2bd4eefb01 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -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_next_child(const struct device_node *node, 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 void of_node_put(struct device_node *node);