aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/prom_common.c5
-rw-r--r--drivers/of/base.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 9f20566b0773..79cc0d1a477d 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -54,6 +54,7 @@ EXPORT_SYMBOL(of_set_property_mutex);
54int of_set_property(struct device_node *dp, const char *name, void *val, int len) 54int of_set_property(struct device_node *dp, const char *name, void *val, int len)
55{ 55{
56 struct property **prevp; 56 struct property **prevp;
57 unsigned long flags;
57 void *new_val; 58 void *new_val;
58 int err; 59 int err;
59 60
@@ -64,7 +65,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
64 err = -ENODEV; 65 err = -ENODEV;
65 66
66 mutex_lock(&of_set_property_mutex); 67 mutex_lock(&of_set_property_mutex);
67 raw_spin_lock(&devtree_lock); 68 raw_spin_lock_irqsave(&devtree_lock, flags);
68 prevp = &dp->properties; 69 prevp = &dp->properties;
69 while (*prevp) { 70 while (*prevp) {
70 struct property *prop = *prevp; 71 struct property *prop = *prevp;
@@ -91,7 +92,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
91 } 92 }
92 prevp = &(*prevp)->next; 93 prevp = &(*prevp)->next;
93 } 94 }
94 raw_spin_unlock(&devtree_lock); 95 raw_spin_unlock_irqrestore(&devtree_lock, flags);
95 mutex_unlock(&of_set_property_mutex); 96 mutex_unlock(&of_set_property_mutex);
96 97
97 /* XXX Upate procfs if necessary... */ 98 /* XXX Upate procfs if necessary... */
diff --git a/drivers/of/base.c b/drivers/of/base.c
index f53b992f060a..a6f584a7f4a1 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -192,14 +192,15 @@ EXPORT_SYMBOL(of_find_property);
192struct device_node *of_find_all_nodes(struct device_node *prev) 192struct device_node *of_find_all_nodes(struct device_node *prev)
193{ 193{
194 struct device_node *np; 194 struct device_node *np;
195 unsigned long flags;
195 196
196 raw_spin_lock(&devtree_lock); 197 raw_spin_lock_irqsave(&devtree_lock, flags);
197 np = prev ? prev->allnext : of_allnodes; 198 np = prev ? prev->allnext : of_allnodes;
198 for (; np != NULL; np = np->allnext) 199 for (; np != NULL; np = np->allnext)
199 if (of_node_get(np)) 200 if (of_node_get(np))
200 break; 201 break;
201 of_node_put(prev); 202 of_node_put(prev);
202 raw_spin_unlock(&devtree_lock); 203 raw_spin_unlock_irqrestore(&devtree_lock, flags);
203 return np; 204 return np;
204} 205}
205EXPORT_SYMBOL(of_find_all_nodes); 206EXPORT_SYMBOL(of_find_all_nodes);
@@ -421,8 +422,9 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
421 struct device_node *prev) 422 struct device_node *prev)
422{ 423{
423 struct device_node *next; 424 struct device_node *next;
425 unsigned long flags;
424 426
425 raw_spin_lock(&devtree_lock); 427 raw_spin_lock_irqsave(&devtree_lock, flags);
426 next = prev ? prev->sibling : node->child; 428 next = prev ? prev->sibling : node->child;
427 for (; next; next = next->sibling) { 429 for (; next; next = next->sibling) {
428 if (!__of_device_is_available(next)) 430 if (!__of_device_is_available(next))
@@ -431,7 +433,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
431 break; 433 break;
432 } 434 }
433 of_node_put(prev); 435 of_node_put(prev);
434 raw_spin_unlock(&devtree_lock); 436 raw_spin_unlock_irqrestore(&devtree_lock, flags);
435 return next; 437 return next;
436} 438}
437EXPORT_SYMBOL(of_get_next_available_child); 439EXPORT_SYMBOL(of_get_next_available_child);
@@ -735,13 +737,14 @@ EXPORT_SYMBOL_GPL(of_modalias_node);
735struct device_node *of_find_node_by_phandle(phandle handle) 737struct device_node *of_find_node_by_phandle(phandle handle)
736{ 738{
737 struct device_node *np; 739 struct device_node *np;
740 unsigned long flags;
738 741
739 raw_spin_lock(&devtree_lock); 742 raw_spin_lock_irqsave(&devtree_lock, flags);
740 for (np = of_allnodes; np; np = np->allnext) 743 for (np = of_allnodes; np; np = np->allnext)
741 if (np->phandle == handle) 744 if (np->phandle == handle)
742 break; 745 break;
743 of_node_get(np); 746 of_node_get(np);
744 raw_spin_unlock(&devtree_lock); 747 raw_spin_unlock_irqrestore(&devtree_lock, flags);
745 return np; 748 return np;
746} 749}
747EXPORT_SYMBOL(of_find_node_by_phandle); 750EXPORT_SYMBOL(of_find_node_by_phandle);