diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/of_device_32.c | 21 | ||||
-rw-r--r-- | arch/sparc/kernel/of_device_64.c | 21 | ||||
-rw-r--r-- | arch/sparc/kernel/of_device_common.c | 3 |
3 files changed, 10 insertions, 35 deletions
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 331de91ad2bc..75fc9d5cd7e6 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c | |||
@@ -424,7 +424,7 @@ build_resources: | |||
424 | build_device_resources(op, parent); | 424 | build_device_resources(op, parent); |
425 | 425 | ||
426 | op->dev.parent = parent; | 426 | op->dev.parent = parent; |
427 | op->dev.bus = &of_platform_bus_type; | 427 | op->dev.bus = &platform_bus_type; |
428 | if (!parent) | 428 | if (!parent) |
429 | dev_set_name(&op->dev, "root"); | 429 | dev_set_name(&op->dev, "root"); |
430 | else | 430 | else |
@@ -452,30 +452,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) | |||
452 | } | 452 | } |
453 | } | 453 | } |
454 | 454 | ||
455 | static void __init scan_of_devices(void) | 455 | static int __init scan_of_devices(void) |
456 | { | 456 | { |
457 | struct device_node *root = of_find_node_by_path("/"); | 457 | struct device_node *root = of_find_node_by_path("/"); |
458 | struct of_device *parent; | 458 | struct of_device *parent; |
459 | 459 | ||
460 | parent = scan_one_device(root, NULL); | 460 | parent = scan_one_device(root, NULL); |
461 | if (!parent) | 461 | if (!parent) |
462 | return; | 462 | return 0; |
463 | 463 | ||
464 | scan_tree(root->child, &parent->dev); | 464 | scan_tree(root->child, &parent->dev); |
465 | return 0; | ||
465 | } | 466 | } |
466 | 467 | postcore_initcall(scan_of_devices); | |
467 | static int __init of_bus_driver_init(void) | ||
468 | { | ||
469 | int err; | ||
470 | |||
471 | err = of_bus_type_init(&of_platform_bus_type, "of"); | ||
472 | if (!err) | ||
473 | scan_of_devices(); | ||
474 | |||
475 | return err; | ||
476 | } | ||
477 | |||
478 | postcore_initcall(of_bus_driver_init); | ||
479 | 468 | ||
480 | static int __init of_debug(char *str) | 469 | static int __init of_debug(char *str) |
481 | { | 470 | { |
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index 5e8cbb942d3d..9743d1d9fa03 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c | |||
@@ -667,7 +667,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
667 | op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]); | 667 | op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]); |
668 | 668 | ||
669 | op->dev.parent = parent; | 669 | op->dev.parent = parent; |
670 | op->dev.bus = &of_platform_bus_type; | 670 | op->dev.bus = &platform_bus_type; |
671 | if (!parent) | 671 | if (!parent) |
672 | dev_set_name(&op->dev, "root"); | 672 | dev_set_name(&op->dev, "root"); |
673 | else | 673 | else |
@@ -695,30 +695,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) | |||
695 | } | 695 | } |
696 | } | 696 | } |
697 | 697 | ||
698 | static void __init scan_of_devices(void) | 698 | static int __init scan_of_devices(void) |
699 | { | 699 | { |
700 | struct device_node *root = of_find_node_by_path("/"); | 700 | struct device_node *root = of_find_node_by_path("/"); |
701 | struct of_device *parent; | 701 | struct of_device *parent; |
702 | 702 | ||
703 | parent = scan_one_device(root, NULL); | 703 | parent = scan_one_device(root, NULL); |
704 | if (!parent) | 704 | if (!parent) |
705 | return; | 705 | return 0; |
706 | 706 | ||
707 | scan_tree(root->child, &parent->dev); | 707 | scan_tree(root->child, &parent->dev); |
708 | return 0; | ||
708 | } | 709 | } |
709 | 710 | postcore_initcall(scan_of_devices); | |
710 | static int __init of_bus_driver_init(void) | ||
711 | { | ||
712 | int err; | ||
713 | |||
714 | err = of_bus_type_init(&of_platform_bus_type, "of"); | ||
715 | if (!err) | ||
716 | scan_of_devices(); | ||
717 | |||
718 | return err; | ||
719 | } | ||
720 | |||
721 | postcore_initcall(of_bus_driver_init); | ||
722 | 711 | ||
723 | static int __init of_debug(char *str) | 712 | static int __init of_debug(char *str) |
724 | { | 713 | { |
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c index 016c947d4cae..01f380c7995c 100644 --- a/arch/sparc/kernel/of_device_common.c +++ b/arch/sparc/kernel/of_device_common.c | |||
@@ -64,9 +64,6 @@ void of_propagate_archdata(struct of_device *bus) | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | struct bus_type of_platform_bus_type; | ||
68 | EXPORT_SYMBOL(of_platform_bus_type); | ||
69 | |||
70 | static void get_cells(struct device_node *dp, int *addrc, int *sizec) | 67 | static void get_cells(struct device_node *dp, int *addrc, int *sizec) |
71 | { | 68 | { |
72 | if (addrc) | 69 | if (addrc) |