diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-12-06 09:58:01 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-10 21:42:30 -0500 |
commit | 53761746ec98c526c7d82dcf8246cbde9f09e743 (patch) | |
tree | 4ac1f179157cc955ae03b827d0339de7345db907 /arch/powerpc/platforms/iseries | |
parent | 3b32c162bb2be2075508cdc2260e6a6853335581 (diff) |
[POWERPC] iSeries: Make pcibios_final_fixup not depend on pci_dn
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/iseries')
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 7e00e35b86d0..4bcf446cbebf 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -188,39 +188,36 @@ void __init iSeries_pci_final_fixup(void) | |||
188 | 188 | ||
189 | printk("pcibios_final_fixup\n"); | 189 | printk("pcibios_final_fixup\n"); |
190 | for_each_pci_dev(pdev) { | 190 | for_each_pci_dev(pdev) { |
191 | struct pci_dn *pdn; | ||
192 | const u32 *agent; | 191 | const u32 *agent; |
193 | const u32 *sub_bus; | 192 | const u32 *sub_bus; |
193 | unsigned char bus = pdev->bus->number; | ||
194 | 194 | ||
195 | node = find_device_node(pdev->bus->number, pdev->devfn); | 195 | node = find_device_node(bus, pdev->devfn); |
196 | printk("pci dev %p (%x.%x), node %p\n", pdev, | 196 | printk("pci dev %p (%x.%x), node %p\n", pdev, bus, |
197 | pdev->bus->number, pdev->devfn, node); | 197 | pdev->devfn, node); |
198 | if (!node) { | 198 | if (!node) { |
199 | printk("PCI: Device Tree not found for 0x%016lX\n", | 199 | printk("PCI: Device Tree not found for 0x%016lX\n", |
200 | (unsigned long)pdev); | 200 | (unsigned long)pdev); |
201 | continue; | 201 | continue; |
202 | } | 202 | } |
203 | 203 | ||
204 | pdn = PCI_DN(node); | ||
205 | agent = of_get_property(node, "linux,agent-id", NULL); | 204 | agent = of_get_property(node, "linux,agent-id", NULL); |
206 | sub_bus = of_get_property(node, "linux,subbus", NULL); | 205 | sub_bus = of_get_property(node, "linux,subbus", NULL); |
207 | if (pdn && agent && sub_bus) { | 206 | if (agent && sub_bus) { |
208 | u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, *sub_bus); | 207 | u8 irq = iSeries_allocate_IRQ(bus, 0, *sub_bus); |
209 | int err; | 208 | int err; |
210 | 209 | ||
211 | err = HvCallXm_connectBusUnit(pdn->busno, *sub_bus, | 210 | err = HvCallXm_connectBusUnit(bus, *sub_bus, |
212 | *agent, irq); | 211 | *agent, irq); |
213 | if (err) | 212 | if (err) |
214 | pci_log_error("Connect Bus Unit", | 213 | pci_log_error("Connect Bus Unit", |
215 | pdn->busno, *sub_bus, *agent, err); | 214 | bus, *sub_bus, *agent, err); |
216 | else { | 215 | else { |
217 | err = HvCallPci_configStore8(pdn->busno, | 216 | err = HvCallPci_configStore8(bus, *sub_bus, |
218 | *sub_bus, *agent, | 217 | *agent, PCI_INTERRUPT_LINE, irq); |
219 | PCI_INTERRUPT_LINE, irq); | ||
220 | if (err) | 218 | if (err) |
221 | pci_log_error("PciCfgStore Irq Failed!", | 219 | pci_log_error("PciCfgStore Irq Failed!", |
222 | pdn->busno, *sub_bus, | 220 | bus, *sub_bus, *agent, err); |
223 | *agent, err); | ||
224 | else | 221 | else |
225 | pdev->irq = irq; | 222 | pdev->irq = irq; |
226 | } | 223 | } |
@@ -230,7 +227,7 @@ void __init iSeries_pci_final_fixup(void) | |||
230 | pdev->sysdata = node; | 227 | pdev->sysdata = node; |
231 | PCI_DN(node)->pcidev = pdev; | 228 | PCI_DN(node)->pcidev = pdev; |
232 | allocate_device_bars(pdev); | 229 | allocate_device_bars(pdev); |
233 | iSeries_Device_Information(pdev, num_dev, pdn->busno, *sub_bus); | 230 | iSeries_Device_Information(pdev, num_dev, bus, *sub_bus); |
234 | iommu_devnode_init_iSeries(pdev, node); | 231 | iommu_devnode_init_iSeries(pdev, node); |
235 | } | 232 | } |
236 | iSeries_activate_IRQs(); | 233 | iSeries_activate_IRQs(); |