[PATCH 5/6] powerpc: powerpc.git version of of_find_property function

Dave C Boutcher sleddog at us.ibm.com
Fri Jan 13 09:09:29 EST 2006


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 <sleddog at us.ibm.com>

 arch/powerpc/kernel/prom.c |   19 +++++++++++++------
 include/asm-powerpc/prom.h |    3 +++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff -uNr powerpc.git.patched2/arch/powerpc/kernel/prom.c powerpc.git.vpm/arch/powerpc/kernel/prom.c
--- powerpc.git.patched2/arch/powerpc/kernel/prom.c	2006-01-12 15:39:04.000000000 -0600
+++ powerpc.git.vpm/arch/powerpc/kernel/prom.c	2006-01-12 15:39:25.000000000 -0600
@@ -1759,12 +1759,8 @@
 __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;
 
@@ -1777,6 +1773,17 @@
 		}
 	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 -uNr powerpc.git.patched2/include/asm-powerpc/prom.h powerpc.git.vpm/include/asm-powerpc/prom.h
--- powerpc.git.patched2/include/asm-powerpc/prom.h	2006-01-12 15:39:04.000000000 -0600
+++ powerpc.git.vpm/include/asm-powerpc/prom.h	2006-01-12 15:39:25.000000000 -0600
@@ -136,6 +136,9 @@
 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);
 

-- 
Dave Boutcher



More information about the Linuxppc64-dev mailing list