diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
| -rw-r--r-- | arch/powerpc/kernel/prom.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 4ec300862466..a8b952e5d4b8 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -81,7 +81,7 @@ struct boot_param_header *initial_boot_params; | |||
| 81 | 81 | ||
| 82 | extern struct device_node *allnodes; /* temporary while merging */ | 82 | extern struct device_node *allnodes; /* temporary while merging */ |
| 83 | 83 | ||
| 84 | extern rwlock_t devtree_lock; /* temporary while merging */ | 84 | extern raw_spinlock_t devtree_lock; /* temporary while merging */ |
| 85 | 85 | ||
| 86 | /* export that to outside world */ | 86 | /* export that to outside world */ |
| 87 | struct device_node *of_chosen; | 87 | struct device_node *of_chosen; |
| @@ -1275,12 +1275,12 @@ struct device_node *of_find_node_by_phandle(phandle handle) | |||
| 1275 | { | 1275 | { |
| 1276 | struct device_node *np; | 1276 | struct device_node *np; |
| 1277 | 1277 | ||
| 1278 | read_lock(&devtree_lock); | 1278 | raw_spin_lock(&devtree_lock); |
| 1279 | for (np = allnodes; np != 0; np = np->allnext) | 1279 | for (np = allnodes; np != 0; np = np->allnext) |
| 1280 | if (np->linux_phandle == handle) | 1280 | if (np->linux_phandle == handle) |
| 1281 | break; | 1281 | break; |
| 1282 | of_node_get(np); | 1282 | of_node_get(np); |
| 1283 | read_unlock(&devtree_lock); | 1283 | raw_spin_unlock(&devtree_lock); |
| 1284 | return np; | 1284 | return np; |
| 1285 | } | 1285 | } |
| 1286 | EXPORT_SYMBOL(of_find_node_by_phandle); | 1286 | EXPORT_SYMBOL(of_find_node_by_phandle); |
| @@ -1396,12 +1396,12 @@ void of_attach_node(struct device_node *np) | |||
| 1396 | { | 1396 | { |
| 1397 | unsigned long flags; | 1397 | unsigned long flags; |
| 1398 | 1398 | ||
| 1399 | write_lock_irqsave(&devtree_lock, flags); | 1399 | raw_spin_lock_irqsave(&devtree_lock, flags); |
| 1400 | np->sibling = np->parent->child; | 1400 | np->sibling = np->parent->child; |
| 1401 | np->allnext = allnodes; | 1401 | np->allnext = allnodes; |
| 1402 | np->parent->child = np; | 1402 | np->parent->child = np; |
| 1403 | allnodes = np; | 1403 | allnodes = np; |
| 1404 | write_unlock_irqrestore(&devtree_lock, flags); | 1404 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1405 | } | 1405 | } |
| 1406 | 1406 | ||
| 1407 | /* | 1407 | /* |
| @@ -1414,7 +1414,7 @@ void of_detach_node(struct device_node *np) | |||
| 1414 | struct device_node *parent; | 1414 | struct device_node *parent; |
| 1415 | unsigned long flags; | 1415 | unsigned long flags; |
| 1416 | 1416 | ||
| 1417 | write_lock_irqsave(&devtree_lock, flags); | 1417 | raw_spin_lock_irqsave(&devtree_lock, flags); |
| 1418 | 1418 | ||
| 1419 | parent = np->parent; | 1419 | parent = np->parent; |
| 1420 | if (!parent) | 1420 | if (!parent) |
| @@ -1445,7 +1445,7 @@ void of_detach_node(struct device_node *np) | |||
| 1445 | of_node_set_flag(np, OF_DETACHED); | 1445 | of_node_set_flag(np, OF_DETACHED); |
| 1446 | 1446 | ||
| 1447 | out_unlock: | 1447 | out_unlock: |
| 1448 | write_unlock_irqrestore(&devtree_lock, flags); | 1448 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1449 | } | 1449 | } |
| 1450 | 1450 | ||
| 1451 | #ifdef CONFIG_PPC_PSERIES | 1451 | #ifdef CONFIG_PPC_PSERIES |
| @@ -1529,18 +1529,18 @@ int prom_add_property(struct device_node* np, struct property* prop) | |||
| 1529 | unsigned long flags; | 1529 | unsigned long flags; |
| 1530 | 1530 | ||
| 1531 | prop->next = NULL; | 1531 | prop->next = NULL; |
| 1532 | write_lock_irqsave(&devtree_lock, flags); | 1532 | raw_spin_lock_irqsave(&devtree_lock, flags); |
| 1533 | next = &np->properties; | 1533 | next = &np->properties; |
| 1534 | while (*next) { | 1534 | while (*next) { |
| 1535 | if (strcmp(prop->name, (*next)->name) == 0) { | 1535 | if (strcmp(prop->name, (*next)->name) == 0) { |
| 1536 | /* duplicate ! don't insert it */ | 1536 | /* duplicate ! don't insert it */ |
| 1537 | write_unlock_irqrestore(&devtree_lock, flags); | 1537 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1538 | return -1; | 1538 | return -1; |
| 1539 | } | 1539 | } |
| 1540 | next = &(*next)->next; | 1540 | next = &(*next)->next; |
| 1541 | } | 1541 | } |
| 1542 | *next = prop; | 1542 | *next = prop; |
| 1543 | write_unlock_irqrestore(&devtree_lock, flags); | 1543 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1544 | 1544 | ||
| 1545 | #ifdef CONFIG_PROC_DEVICETREE | 1545 | #ifdef CONFIG_PROC_DEVICETREE |
| 1546 | /* try to add to proc as well if it was initialized */ | 1546 | /* try to add to proc as well if it was initialized */ |
| @@ -1563,7 +1563,7 @@ int prom_remove_property(struct device_node *np, struct property *prop) | |||
| 1563 | unsigned long flags; | 1563 | unsigned long flags; |
| 1564 | int found = 0; | 1564 | int found = 0; |
| 1565 | 1565 | ||
| 1566 | write_lock_irqsave(&devtree_lock, flags); | 1566 | raw_spin_lock_irqsave(&devtree_lock, flags); |
| 1567 | next = &np->properties; | 1567 | next = &np->properties; |
| 1568 | while (*next) { | 1568 | while (*next) { |
| 1569 | if (*next == prop) { | 1569 | if (*next == prop) { |
| @@ -1576,7 +1576,7 @@ int prom_remove_property(struct device_node *np, struct property *prop) | |||
| 1576 | } | 1576 | } |
| 1577 | next = &(*next)->next; | 1577 | next = &(*next)->next; |
| 1578 | } | 1578 | } |
| 1579 | write_unlock_irqrestore(&devtree_lock, flags); | 1579 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1580 | 1580 | ||
| 1581 | if (!found) | 1581 | if (!found) |
| 1582 | return -ENODEV; | 1582 | return -ENODEV; |
| @@ -1605,7 +1605,7 @@ int prom_update_property(struct device_node *np, | |||
| 1605 | unsigned long flags; | 1605 | unsigned long flags; |
| 1606 | int found = 0; | 1606 | int found = 0; |
| 1607 | 1607 | ||
| 1608 | write_lock_irqsave(&devtree_lock, flags); | 1608 | raw_spin_lock_irqsave(&devtree_lock, flags); |
| 1609 | next = &np->properties; | 1609 | next = &np->properties; |
| 1610 | while (*next) { | 1610 | while (*next) { |
| 1611 | if (*next == oldprop) { | 1611 | if (*next == oldprop) { |
| @@ -1619,7 +1619,7 @@ int prom_update_property(struct device_node *np, | |||
| 1619 | } | 1619 | } |
| 1620 | next = &(*next)->next; | 1620 | next = &(*next)->next; |
| 1621 | } | 1621 | } |
| 1622 | write_unlock_irqrestore(&devtree_lock, flags); | 1622 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
| 1623 | 1623 | ||
| 1624 | if (!found) | 1624 | if (!found) |
| 1625 | return -ENODEV; | 1625 | return -ENODEV; |
