aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powermac/pci.c')
-rw-r--r--arch/powerpc/platforms/powermac/pci.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 092cef4160a1..22c4ae4c6934 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -622,13 +622,14 @@ static void __init init_p2pbridge(void)
622 622
623 /* XXX it would be better here to identify the specific 623 /* XXX it would be better here to identify the specific
624 PCI-PCI bridge chip we have. */ 624 PCI-PCI bridge chip we have. */
625 if ((p2pbridge = find_devices("pci-bridge")) == 0 625 p2pbridge = of_find_node_by_name(NULL, "pci-bridge");
626 if (p2pbridge == NULL
626 || p2pbridge->parent == NULL 627 || p2pbridge->parent == NULL
627 || strcmp(p2pbridge->parent->name, "pci") != 0) 628 || strcmp(p2pbridge->parent->name, "pci") != 0)
628 return; 629 goto done;
629 if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) { 630 if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) {
630 DBG("Can't find PCI infos for PCI<->PCI bridge\n"); 631 DBG("Can't find PCI infos for PCI<->PCI bridge\n");
631 return; 632 goto done;
632 } 633 }
633 /* Warning: At this point, we have not yet renumbered all busses. 634 /* Warning: At this point, we have not yet renumbered all busses.
634 * So we must use OF walking to find out hose 635 * So we must use OF walking to find out hose
@@ -636,16 +637,18 @@ static void __init init_p2pbridge(void)
636 hose = pci_find_hose_for_OF_device(p2pbridge); 637 hose = pci_find_hose_for_OF_device(p2pbridge);
637 if (!hose) { 638 if (!hose) {
638 DBG("Can't find hose for PCI<->PCI bridge\n"); 639 DBG("Can't find hose for PCI<->PCI bridge\n");
639 return; 640 goto done;
640 } 641 }
641 if (early_read_config_word(hose, bus, devfn, 642 if (early_read_config_word(hose, bus, devfn,
642 PCI_BRIDGE_CONTROL, &val) < 0) { 643 PCI_BRIDGE_CONTROL, &val) < 0) {
643 printk(KERN_ERR "init_p2pbridge: couldn't read bridge" 644 printk(KERN_ERR "init_p2pbridge: couldn't read bridge"
644 " control\n"); 645 " control\n");
645 return; 646 goto done;
646 } 647 }
647 val &= ~PCI_BRIDGE_CTL_MASTER_ABORT; 648 val &= ~PCI_BRIDGE_CTL_MASTER_ABORT;
648 early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val); 649 early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val);
650done:
651 of_node_put(p2pbridge);
649} 652}
650 653
651static void __init init_second_ohare(void) 654static void __init init_second_ohare(void)
@@ -1199,8 +1202,7 @@ void __init pmac_pcibios_after_init(void)
1199 } 1202 }
1200#endif /* CONFIG_BLK_DEV_IDE */ 1203#endif /* CONFIG_BLK_DEV_IDE */
1201 1204
1202 nd = find_devices("firewire"); 1205 for_each_node_by_name(nd, "firewire") {
1203 while (nd) {
1204 if (nd->parent && (device_is_compatible(nd, "pci106b,18") || 1206 if (nd->parent && (device_is_compatible(nd, "pci106b,18") ||
1205 device_is_compatible(nd, "pci106b,30") || 1207 device_is_compatible(nd, "pci106b,30") ||
1206 device_is_compatible(nd, "pci11c1,5811")) 1208 device_is_compatible(nd, "pci11c1,5811"))
@@ -1208,15 +1210,14 @@ void __init pmac_pcibios_after_init(void)
1208 pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0); 1210 pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0);
1209 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); 1211 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
1210 } 1212 }
1211 nd = nd->next;
1212 } 1213 }
1213 nd = find_devices("ethernet"); 1214 of_node_put(nd);
1214 while (nd) { 1215 for_each_node_by_name(nd, "ethernet") {
1215 if (nd->parent && device_is_compatible(nd, "gmac") 1216 if (nd->parent && device_is_compatible(nd, "gmac")
1216 && device_is_compatible(nd->parent, "uni-north")) 1217 && device_is_compatible(nd->parent, "uni-north"))
1217 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); 1218 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
1218 nd = nd->next;
1219 } 1219 }
1220 of_node_put(nd);
1220} 1221}
1221 1222
1222#ifdef CONFIG_PPC32 1223#ifdef CONFIG_PPC32