diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2013-02-13 04:59:13 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-13 04:59:13 -0500 |
commit | bfc4a58986ba3934bb256ef3567aeeab262aa959 (patch) | |
tree | bd26e4a6a10e19b510cec9674448bdb18633630a | |
parent | 09495dda6a62c74b13412a63528093910ef80edd (diff) | |
parent | 1421954bf9b967d819db23c911f950a2ccd60eff (diff) |
Merge branch 'for-next' from git://sources.calxeda.com/kernel/linux.git
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r-- | Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/prom_common.c | 4 | ||||
-rw-r--r-- | drivers/of/base.c | 100 | ||||
-rw-r--r-- | include/linux/of.h | 2 |
4 files changed, 60 insertions, 48 deletions
diff --git a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt index 898b22294ba9..6d1c0988cfc7 100644 --- a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt +++ b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt | |||
@@ -4,7 +4,7 @@ | |||
4 | The Synopsis designware mobile storage host controller is used to interface | 4 | The Synopsis designware mobile storage host controller is used to interface |
5 | a SoC with storage medium such as eMMC or SD/MMC cards. This file documents | 5 | a SoC with storage medium such as eMMC or SD/MMC cards. This file documents |
6 | differences between the core Synopsis dw mshc controller properties described | 6 | differences between the core Synopsis dw mshc controller properties described |
7 | by synposis-dw-mshc.txt and the properties used by the Samsung Exynos specific | 7 | by synopsis-dw-mshc.txt and the properties used by the Samsung Exynos specific |
8 | extensions to the Synopsis Designware Mobile Storage Host Controller. | 8 | extensions to the Synopsis Designware Mobile Storage Host Controller. |
9 | 9 | ||
10 | Required Properties: | 10 | Required Properties: |
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c index 1303021748c8..9f20566b0773 100644 --- a/arch/sparc/kernel/prom_common.c +++ b/arch/sparc/kernel/prom_common.c | |||
@@ -64,7 +64,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len | |||
64 | err = -ENODEV; | 64 | err = -ENODEV; |
65 | 65 | ||
66 | mutex_lock(&of_set_property_mutex); | 66 | mutex_lock(&of_set_property_mutex); |
67 | write_lock(&devtree_lock); | 67 | raw_spin_lock(&devtree_lock); |
68 | prevp = &dp->properties; | 68 | prevp = &dp->properties; |
69 | while (*prevp) { | 69 | while (*prevp) { |
70 | struct property *prop = *prevp; | 70 | struct property *prop = *prevp; |
@@ -91,7 +91,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len | |||
91 | } | 91 | } |
92 | prevp = &(*prevp)->next; | 92 | prevp = &(*prevp)->next; |
93 | } | 93 | } |
94 | write_unlock(&devtree_lock); | 94 | raw_spin_unlock(&devtree_lock); |
95 | mutex_unlock(&of_set_property_mutex); | 95 | mutex_unlock(&of_set_property_mutex); |
96 | 96 | ||
97 | /* XXX Upate procfs if necessary... */ | 97 | /* XXX Upate procfs if necessary... */ |
diff --git a/drivers/of/base.c b/drivers/of/base.c index 8b9fa83dc77b..e8d65aff8639 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -38,7 +38,7 @@ DEFINE_MUTEX(of_aliases_mutex); | |||
38 | /* use when traversing tree through the allnext, child, sibling, | 38 | /* use when traversing tree through the allnext, child, sibling, |
39 | * or parent members of struct device_node. | 39 | * or parent members of struct device_node. |
40 | */ | 40 | */ |
41 | DEFINE_RWLOCK(devtree_lock); | 41 | DEFINE_RAW_SPINLOCK(devtree_lock); |
42 | 42 | ||
43 | int of_n_addr_cells(struct device_node *np) | 43 | int of_n_addr_cells(struct device_node *np) |
44 | { | 44 | { |
@@ -171,10 +171,11 @@ struct property *of_find_property(const struct device_node *np, | |||
171 | int *lenp) | 171 | int *lenp) |
172 | { | 172 | { |
173 | struct property *pp; | 173 | struct property *pp; |
174 | unsigned long flags; | ||
174 | 175 | ||
175 | read_lock(&devtree_lock); | 176 | raw_spin_lock_irqsave(&devtree_lock, flags); |
176 | pp = __of_find_property(np, name, lenp); | 177 | pp = __of_find_property(np, name, lenp); |
177 | read_unlock(&devtree_lock); | 178 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
178 | 179 | ||
179 | return pp; | 180 | return pp; |
180 | } | 181 | } |
@@ -192,13 +193,13 @@ struct device_node *of_find_all_nodes(struct device_node *prev) | |||
192 | { | 193 | { |
193 | struct device_node *np; | 194 | struct device_node *np; |
194 | 195 | ||
195 | read_lock(&devtree_lock); | 196 | raw_spin_lock(&devtree_lock); |
196 | np = prev ? prev->allnext : of_allnodes; | 197 | np = prev ? prev->allnext : of_allnodes; |
197 | for (; np != NULL; np = np->allnext) | 198 | for (; np != NULL; np = np->allnext) |
198 | if (of_node_get(np)) | 199 | if (of_node_get(np)) |
199 | break; | 200 | break; |
200 | of_node_put(prev); | 201 | of_node_put(prev); |
201 | read_unlock(&devtree_lock); | 202 | raw_spin_unlock(&devtree_lock); |
202 | return np; | 203 | return np; |
203 | } | 204 | } |
204 | EXPORT_SYMBOL(of_find_all_nodes); | 205 | EXPORT_SYMBOL(of_find_all_nodes); |
@@ -257,11 +258,12 @@ static int __of_device_is_compatible(const struct device_node *device, | |||
257 | int of_device_is_compatible(const struct device_node *device, | 258 | int of_device_is_compatible(const struct device_node *device, |
258 | const char *compat) | 259 | const char *compat) |
259 | { | 260 | { |
261 | unsigned long flags; | ||
260 | int res; | 262 | int res; |
261 | 263 | ||
262 | read_lock(&devtree_lock); | 264 | raw_spin_lock_irqsave(&devtree_lock, flags); |
263 | res = __of_device_is_compatible(device, compat); | 265 | res = __of_device_is_compatible(device, compat); |
264 | read_unlock(&devtree_lock); | 266 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
265 | return res; | 267 | return res; |
266 | } | 268 | } |
267 | EXPORT_SYMBOL(of_device_is_compatible); | 269 | EXPORT_SYMBOL(of_device_is_compatible); |
@@ -323,13 +325,14 @@ EXPORT_SYMBOL(of_device_is_available); | |||
323 | struct device_node *of_get_parent(const struct device_node *node) | 325 | struct device_node *of_get_parent(const struct device_node *node) |
324 | { | 326 | { |
325 | struct device_node *np; | 327 | struct device_node *np; |
328 | unsigned long flags; | ||
326 | 329 | ||
327 | if (!node) | 330 | if (!node) |
328 | return NULL; | 331 | return NULL; |
329 | 332 | ||
330 | read_lock(&devtree_lock); | 333 | raw_spin_lock_irqsave(&devtree_lock, flags); |
331 | np = of_node_get(node->parent); | 334 | np = of_node_get(node->parent); |
332 | read_unlock(&devtree_lock); | 335 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
333 | return np; | 336 | return np; |
334 | } | 337 | } |
335 | EXPORT_SYMBOL(of_get_parent); | 338 | EXPORT_SYMBOL(of_get_parent); |
@@ -348,14 +351,15 @@ EXPORT_SYMBOL(of_get_parent); | |||
348 | struct device_node *of_get_next_parent(struct device_node *node) | 351 | struct device_node *of_get_next_parent(struct device_node *node) |
349 | { | 352 | { |
350 | struct device_node *parent; | 353 | struct device_node *parent; |
354 | unsigned long flags; | ||
351 | 355 | ||
352 | if (!node) | 356 | if (!node) |
353 | return NULL; | 357 | return NULL; |
354 | 358 | ||
355 | read_lock(&devtree_lock); | 359 | raw_spin_lock_irqsave(&devtree_lock, flags); |
356 | parent = of_node_get(node->parent); | 360 | parent = of_node_get(node->parent); |
357 | of_node_put(node); | 361 | of_node_put(node); |
358 | read_unlock(&devtree_lock); | 362 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
359 | return parent; | 363 | return parent; |
360 | } | 364 | } |
361 | 365 | ||
@@ -371,14 +375,15 @@ struct device_node *of_get_next_child(const struct device_node *node, | |||
371 | struct device_node *prev) | 375 | struct device_node *prev) |
372 | { | 376 | { |
373 | struct device_node *next; | 377 | struct device_node *next; |
378 | unsigned long flags; | ||
374 | 379 | ||
375 | read_lock(&devtree_lock); | 380 | raw_spin_lock_irqsave(&devtree_lock, flags); |
376 | next = prev ? prev->sibling : node->child; | 381 | next = prev ? prev->sibling : node->child; |
377 | for (; next; next = next->sibling) | 382 | for (; next; next = next->sibling) |
378 | if (of_node_get(next)) | 383 | if (of_node_get(next)) |
379 | break; | 384 | break; |
380 | of_node_put(prev); | 385 | of_node_put(prev); |
381 | read_unlock(&devtree_lock); | 386 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
382 | return next; | 387 | return next; |
383 | } | 388 | } |
384 | EXPORT_SYMBOL(of_get_next_child); | 389 | EXPORT_SYMBOL(of_get_next_child); |
@@ -396,7 +401,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node, | |||
396 | { | 401 | { |
397 | struct device_node *next; | 402 | struct device_node *next; |
398 | 403 | ||
399 | read_lock(&devtree_lock); | 404 | raw_spin_lock(&devtree_lock); |
400 | next = prev ? prev->sibling : node->child; | 405 | next = prev ? prev->sibling : node->child; |
401 | for (; next; next = next->sibling) { | 406 | for (; next; next = next->sibling) { |
402 | if (!of_device_is_available(next)) | 407 | if (!of_device_is_available(next)) |
@@ -405,7 +410,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node, | |||
405 | break; | 410 | break; |
406 | } | 411 | } |
407 | of_node_put(prev); | 412 | of_node_put(prev); |
408 | read_unlock(&devtree_lock); | 413 | raw_spin_unlock(&devtree_lock); |
409 | return next; | 414 | return next; |
410 | } | 415 | } |
411 | EXPORT_SYMBOL(of_get_next_available_child); | 416 | EXPORT_SYMBOL(of_get_next_available_child); |
@@ -443,14 +448,15 @@ EXPORT_SYMBOL(of_get_child_by_name); | |||
443 | struct device_node *of_find_node_by_path(const char *path) | 448 | struct device_node *of_find_node_by_path(const char *path) |
444 | { | 449 | { |
445 | struct device_node *np = of_allnodes; | 450 | struct device_node *np = of_allnodes; |
451 | unsigned long flags; | ||
446 | 452 | ||
447 | read_lock(&devtree_lock); | 453 | raw_spin_lock_irqsave(&devtree_lock, flags); |
448 | for (; np; np = np->allnext) { | 454 | for (; np; np = np->allnext) { |
449 | if (np->full_name && (of_node_cmp(np->full_name, path) == 0) | 455 | if (np->full_name && (of_node_cmp(np->full_name, path) == 0) |
450 | && of_node_get(np)) | 456 | && of_node_get(np)) |
451 | break; | 457 | break; |
452 | } | 458 | } |
453 | read_unlock(&devtree_lock); | 459 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
454 | return np; | 460 | return np; |
455 | } | 461 | } |
456 | EXPORT_SYMBOL(of_find_node_by_path); | 462 | EXPORT_SYMBOL(of_find_node_by_path); |
@@ -470,15 +476,16 @@ struct device_node *of_find_node_by_name(struct device_node *from, | |||
470 | const char *name) | 476 | const char *name) |
471 | { | 477 | { |
472 | struct device_node *np; | 478 | struct device_node *np; |
479 | unsigned long flags; | ||
473 | 480 | ||
474 | read_lock(&devtree_lock); | 481 | raw_spin_lock_irqsave(&devtree_lock, flags); |
475 | np = from ? from->allnext : of_allnodes; | 482 | np = from ? from->allnext : of_allnodes; |
476 | for (; np; np = np->allnext) | 483 | for (; np; np = np->allnext) |
477 | if (np->name && (of_node_cmp(np->name, name) == 0) | 484 | if (np->name && (of_node_cmp(np->name, name) == 0) |
478 | && of_node_get(np)) | 485 | && of_node_get(np)) |
479 | break; | 486 | break; |
480 | of_node_put(from); | 487 | of_node_put(from); |
481 | read_unlock(&devtree_lock); | 488 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
482 | return np; | 489 | return np; |
483 | } | 490 | } |
484 | EXPORT_SYMBOL(of_find_node_by_name); | 491 | EXPORT_SYMBOL(of_find_node_by_name); |
@@ -499,15 +506,16 @@ struct device_node *of_find_node_by_type(struct device_node *from, | |||
499 | const char *type) | 506 | const char *type) |
500 | { | 507 | { |
501 | struct device_node *np; | 508 | struct device_node *np; |
509 | unsigned long flags; | ||
502 | 510 | ||
503 | read_lock(&devtree_lock); | 511 | raw_spin_lock_irqsave(&devtree_lock, flags); |
504 | np = from ? from->allnext : of_allnodes; | 512 | np = from ? from->allnext : of_allnodes; |
505 | for (; np; np = np->allnext) | 513 | for (; np; np = np->allnext) |
506 | if (np->type && (of_node_cmp(np->type, type) == 0) | 514 | if (np->type && (of_node_cmp(np->type, type) == 0) |
507 | && of_node_get(np)) | 515 | && of_node_get(np)) |
508 | break; | 516 | break; |
509 | of_node_put(from); | 517 | of_node_put(from); |
510 | read_unlock(&devtree_lock); | 518 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
511 | return np; | 519 | return np; |
512 | } | 520 | } |
513 | EXPORT_SYMBOL(of_find_node_by_type); | 521 | EXPORT_SYMBOL(of_find_node_by_type); |
@@ -530,8 +538,9 @@ struct device_node *of_find_compatible_node(struct device_node *from, | |||
530 | const char *type, const char *compatible) | 538 | const char *type, const char *compatible) |
531 | { | 539 | { |
532 | struct device_node *np; | 540 | struct device_node *np; |
541 | unsigned long flags; | ||
533 | 542 | ||
534 | read_lock(&devtree_lock); | 543 | raw_spin_lock_irqsave(&devtree_lock, flags); |
535 | np = from ? from->allnext : of_allnodes; | 544 | np = from ? from->allnext : of_allnodes; |
536 | for (; np; np = np->allnext) { | 545 | for (; np; np = np->allnext) { |
537 | if (type | 546 | if (type |
@@ -542,7 +551,7 @@ struct device_node *of_find_compatible_node(struct device_node *from, | |||
542 | break; | 551 | break; |
543 | } | 552 | } |
544 | of_node_put(from); | 553 | of_node_put(from); |
545 | read_unlock(&devtree_lock); | 554 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
546 | return np; | 555 | return np; |
547 | } | 556 | } |
548 | EXPORT_SYMBOL(of_find_compatible_node); | 557 | EXPORT_SYMBOL(of_find_compatible_node); |
@@ -564,8 +573,9 @@ struct device_node *of_find_node_with_property(struct device_node *from, | |||
564 | { | 573 | { |
565 | struct device_node *np; | 574 | struct device_node *np; |
566 | struct property *pp; | 575 | struct property *pp; |
576 | unsigned long flags; | ||
567 | 577 | ||
568 | read_lock(&devtree_lock); | 578 | raw_spin_lock_irqsave(&devtree_lock, flags); |
569 | np = from ? from->allnext : of_allnodes; | 579 | np = from ? from->allnext : of_allnodes; |
570 | for (; np; np = np->allnext) { | 580 | for (; np; np = np->allnext) { |
571 | for (pp = np->properties; pp; pp = pp->next) { | 581 | for (pp = np->properties; pp; pp = pp->next) { |
@@ -577,7 +587,7 @@ struct device_node *of_find_node_with_property(struct device_node *from, | |||
577 | } | 587 | } |
578 | out: | 588 | out: |
579 | of_node_put(from); | 589 | of_node_put(from); |
580 | read_unlock(&devtree_lock); | 590 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
581 | return np; | 591 | return np; |
582 | } | 592 | } |
583 | EXPORT_SYMBOL(of_find_node_with_property); | 593 | EXPORT_SYMBOL(of_find_node_with_property); |
@@ -618,10 +628,11 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches, | |||
618 | const struct device_node *node) | 628 | const struct device_node *node) |
619 | { | 629 | { |
620 | const struct of_device_id *match; | 630 | const struct of_device_id *match; |
631 | unsigned long flags; | ||
621 | 632 | ||
622 | read_lock(&devtree_lock); | 633 | raw_spin_lock_irqsave(&devtree_lock, flags); |
623 | match = __of_match_node(matches, node); | 634 | match = __of_match_node(matches, node); |
624 | read_unlock(&devtree_lock); | 635 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
625 | return match; | 636 | return match; |
626 | } | 637 | } |
627 | EXPORT_SYMBOL(of_match_node); | 638 | EXPORT_SYMBOL(of_match_node); |
@@ -645,11 +656,12 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from, | |||
645 | { | 656 | { |
646 | struct device_node *np; | 657 | struct device_node *np; |
647 | const struct of_device_id *m; | 658 | const struct of_device_id *m; |
659 | unsigned long flags; | ||
648 | 660 | ||
649 | if (match) | 661 | if (match) |
650 | *match = NULL; | 662 | *match = NULL; |
651 | 663 | ||
652 | read_lock(&devtree_lock); | 664 | raw_spin_lock_irqsave(&devtree_lock, flags); |
653 | np = from ? from->allnext : of_allnodes; | 665 | np = from ? from->allnext : of_allnodes; |
654 | for (; np; np = np->allnext) { | 666 | for (; np; np = np->allnext) { |
655 | m = __of_match_node(matches, np); | 667 | m = __of_match_node(matches, np); |
@@ -660,7 +672,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from, | |||
660 | } | 672 | } |
661 | } | 673 | } |
662 | of_node_put(from); | 674 | of_node_put(from); |
663 | read_unlock(&devtree_lock); | 675 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
664 | return np; | 676 | return np; |
665 | } | 677 | } |
666 | EXPORT_SYMBOL(of_find_matching_node_and_match); | 678 | EXPORT_SYMBOL(of_find_matching_node_and_match); |
@@ -703,12 +715,12 @@ struct device_node *of_find_node_by_phandle(phandle handle) | |||
703 | { | 715 | { |
704 | struct device_node *np; | 716 | struct device_node *np; |
705 | 717 | ||
706 | read_lock(&devtree_lock); | 718 | raw_spin_lock(&devtree_lock); |
707 | for (np = of_allnodes; np; np = np->allnext) | 719 | for (np = of_allnodes; np; np = np->allnext) |
708 | if (np->phandle == handle) | 720 | if (np->phandle == handle) |
709 | break; | 721 | break; |
710 | of_node_get(np); | 722 | of_node_get(np); |
711 | read_unlock(&devtree_lock); | 723 | raw_spin_unlock(&devtree_lock); |
712 | return np; | 724 | return np; |
713 | } | 725 | } |
714 | EXPORT_SYMBOL(of_find_node_by_phandle); | 726 | EXPORT_SYMBOL(of_find_node_by_phandle); |
@@ -1180,18 +1192,18 @@ int of_add_property(struct device_node *np, struct property *prop) | |||
1180 | return rc; | 1192 | return rc; |
1181 | 1193 | ||
1182 | prop->next = NULL; | 1194 | prop->next = NULL; |
1183 | write_lock_irqsave(&devtree_lock, flags); | 1195 | raw_spin_lock_irqsave(&devtree_lock, flags); |
1184 | next = &np->properties; | 1196 | next = &np->properties; |
1185 | while (*next) { | 1197 | while (*next) { |
1186 | if (strcmp(prop->name, (*next)->name) == 0) { | 1198 | if (strcmp(prop->name, (*next)->name) == 0) { |
1187 | /* duplicate ! don't insert it */ | 1199 | /* duplicate ! don't insert it */ |
1188 | write_unlock_irqrestore(&devtree_lock, flags); | 1200 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1189 | return -1; | 1201 | return -1; |
1190 | } | 1202 | } |
1191 | next = &(*next)->next; | 1203 | next = &(*next)->next; |
1192 | } | 1204 | } |
1193 | *next = prop; | 1205 | *next = prop; |
1194 | write_unlock_irqrestore(&devtree_lock, flags); | 1206 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1195 | 1207 | ||
1196 | #ifdef CONFIG_PROC_DEVICETREE | 1208 | #ifdef CONFIG_PROC_DEVICETREE |
1197 | /* try to add to proc as well if it was initialized */ | 1209 | /* try to add to proc as well if it was initialized */ |
@@ -1221,7 +1233,7 @@ int of_remove_property(struct device_node *np, struct property *prop) | |||
1221 | if (rc) | 1233 | if (rc) |
1222 | return rc; | 1234 | return rc; |
1223 | 1235 | ||
1224 | write_lock_irqsave(&devtree_lock, flags); | 1236 | raw_spin_lock_irqsave(&devtree_lock, flags); |
1225 | next = &np->properties; | 1237 | next = &np->properties; |
1226 | while (*next) { | 1238 | while (*next) { |
1227 | if (*next == prop) { | 1239 | if (*next == prop) { |
@@ -1234,7 +1246,7 @@ int of_remove_property(struct device_node *np, struct property *prop) | |||
1234 | } | 1246 | } |
1235 | next = &(*next)->next; | 1247 | next = &(*next)->next; |
1236 | } | 1248 | } |
1237 | write_unlock_irqrestore(&devtree_lock, flags); | 1249 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1238 | 1250 | ||
1239 | if (!found) | 1251 | if (!found) |
1240 | return -ENODEV; | 1252 | return -ENODEV; |
@@ -1274,7 +1286,7 @@ int of_update_property(struct device_node *np, struct property *newprop) | |||
1274 | if (!oldprop) | 1286 | if (!oldprop) |
1275 | return of_add_property(np, newprop); | 1287 | return of_add_property(np, newprop); |
1276 | 1288 | ||
1277 | write_lock_irqsave(&devtree_lock, flags); | 1289 | raw_spin_lock_irqsave(&devtree_lock, flags); |
1278 | next = &np->properties; | 1290 | next = &np->properties; |
1279 | while (*next) { | 1291 | while (*next) { |
1280 | if (*next == oldprop) { | 1292 | if (*next == oldprop) { |
@@ -1288,7 +1300,7 @@ int of_update_property(struct device_node *np, struct property *newprop) | |||
1288 | } | 1300 | } |
1289 | next = &(*next)->next; | 1301 | next = &(*next)->next; |
1290 | } | 1302 | } |
1291 | write_unlock_irqrestore(&devtree_lock, flags); | 1303 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1292 | 1304 | ||
1293 | if (!found) | 1305 | if (!found) |
1294 | return -ENODEV; | 1306 | return -ENODEV; |
@@ -1361,12 +1373,12 @@ int of_attach_node(struct device_node *np) | |||
1361 | if (rc) | 1373 | if (rc) |
1362 | return rc; | 1374 | return rc; |
1363 | 1375 | ||
1364 | write_lock_irqsave(&devtree_lock, flags); | 1376 | raw_spin_lock_irqsave(&devtree_lock, flags); |
1365 | np->sibling = np->parent->child; | 1377 | np->sibling = np->parent->child; |
1366 | np->allnext = of_allnodes; | 1378 | np->allnext = of_allnodes; |
1367 | np->parent->child = np; | 1379 | np->parent->child = np; |
1368 | of_allnodes = np; | 1380 | of_allnodes = np; |
1369 | write_unlock_irqrestore(&devtree_lock, flags); | 1381 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1370 | 1382 | ||
1371 | of_add_proc_dt_entry(np); | 1383 | of_add_proc_dt_entry(np); |
1372 | return 0; | 1384 | return 0; |
@@ -1409,17 +1421,17 @@ int of_detach_node(struct device_node *np) | |||
1409 | if (rc) | 1421 | if (rc) |
1410 | return rc; | 1422 | return rc; |
1411 | 1423 | ||
1412 | write_lock_irqsave(&devtree_lock, flags); | 1424 | raw_spin_lock_irqsave(&devtree_lock, flags); |
1413 | 1425 | ||
1414 | if (of_node_check_flag(np, OF_DETACHED)) { | 1426 | if (of_node_check_flag(np, OF_DETACHED)) { |
1415 | /* someone already detached it */ | 1427 | /* someone already detached it */ |
1416 | write_unlock_irqrestore(&devtree_lock, flags); | 1428 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1417 | return rc; | 1429 | return rc; |
1418 | } | 1430 | } |
1419 | 1431 | ||
1420 | parent = np->parent; | 1432 | parent = np->parent; |
1421 | if (!parent) { | 1433 | if (!parent) { |
1422 | write_unlock_irqrestore(&devtree_lock, flags); | 1434 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1423 | return rc; | 1435 | return rc; |
1424 | } | 1436 | } |
1425 | 1437 | ||
@@ -1446,7 +1458,7 @@ int of_detach_node(struct device_node *np) | |||
1446 | } | 1458 | } |
1447 | 1459 | ||
1448 | of_node_set_flag(np, OF_DETACHED); | 1460 | of_node_set_flag(np, OF_DETACHED); |
1449 | write_unlock_irqrestore(&devtree_lock, flags); | 1461 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
1450 | 1462 | ||
1451 | of_remove_proc_dt_entry(np); | 1463 | of_remove_proc_dt_entry(np); |
1452 | return rc; | 1464 | return rc; |
diff --git a/include/linux/of.h b/include/linux/of.h index 1e0d0c1bfb5e..b9e1b911f0eb 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -92,7 +92,7 @@ static inline void of_node_put(struct device_node *node) { } | |||
92 | extern struct device_node *of_allnodes; | 92 | extern struct device_node *of_allnodes; |
93 | extern struct device_node *of_chosen; | 93 | extern struct device_node *of_chosen; |
94 | extern struct device_node *of_aliases; | 94 | extern struct device_node *of_aliases; |
95 | extern rwlock_t devtree_lock; | 95 | extern raw_spinlock_t devtree_lock; |
96 | 96 | ||
97 | static inline bool of_have_populated_dt(void) | 97 | static inline bool of_have_populated_dt(void) |
98 | { | 98 | { |