aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/prom.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-04-24 02:46:53 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2007-07-19 23:32:24 -0400
commit581b605a83ec241a2aff8ef780e08b9414c8dfd8 (patch)
tree809640a0dc3a1bd0b5afba795cf9f6357f6e3a81 /arch/sparc/kernel/prom.c
parent0081cbc3731de8ad4744ba433af51f17bf27eb9c (diff)
Consolidate of_find_property
The only change here is that a readlock is taken while the property list is being traversed on Sparc where it was not taken previously. Also, Sparc uses strcasecmp to compare property names while PowerPC uses strcmp. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/prom.c')
-rw-r--r--arch/sparc/kernel/prom.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index f2ce0d48e102..0f5aab4326b3 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -27,10 +27,7 @@
27 27
28static struct device_node *allnodes; 28static struct device_node *allnodes;
29 29
30/* use when traversing tree through the allnext, child, sibling, 30extern rwlock_t devtree_lock; /* temporary while merging */
31 * or parent members of struct device_node.
32 */
33static DEFINE_RWLOCK(devtree_lock);
34 31
35struct device_node *of_get_parent(const struct device_node *node) 32struct device_node *of_get_parent(const struct device_node *node)
36{ 33{
@@ -130,23 +127,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
130} 127}
131EXPORT_SYMBOL(of_find_compatible_node); 128EXPORT_SYMBOL(of_find_compatible_node);
132 129
133struct property *of_find_property(const struct device_node *np,
134 const char *name,
135 int *lenp)
136{
137 struct property *pp;
138
139 for (pp = np->properties; pp != 0; pp = pp->next) {
140 if (strcasecmp(pp->name, name) == 0) {
141 if (lenp != 0)
142 *lenp = pp->length;
143 break;
144 }
145 }
146 return pp;
147}
148EXPORT_SYMBOL(of_find_property);
149
150int of_getintprop_default(struct device_node *np, const char *name, int def) 130int of_getintprop_default(struct device_node *np, const char *name, int def)
151{ 131{
152 struct property *prop; 132 struct property *prop;