[POWERPC] iSeries: Reduce dependence on pci_dn bussubno

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Stephen Rothwell 2007-12-07 01:56:55 +11:00 committed by Paul Mackerras
parent 2cd1008cf5
commit 3b32c162bb

View file

@ -190,6 +190,7 @@ void __init iSeries_pci_final_fixup(void)
for_each_pci_dev(pdev) { for_each_pci_dev(pdev) {
struct pci_dn *pdn; struct pci_dn *pdn;
const u32 *agent; const u32 *agent;
const u32 *sub_bus;
node = find_device_node(pdev->bus->number, pdev->devfn); node = find_device_node(pdev->bus->number, pdev->devfn);
printk("pci dev %p (%x.%x), node %p\n", pdev, printk("pci dev %p (%x.%x), node %p\n", pdev,
@ -202,23 +203,23 @@ void __init iSeries_pci_final_fixup(void)
pdn = PCI_DN(node); pdn = PCI_DN(node);
agent = of_get_property(node, "linux,agent-id", NULL); agent = of_get_property(node, "linux,agent-id", NULL);
if (pdn && agent) { sub_bus = of_get_property(node, "linux,subbus", NULL);
u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, if (pdn && agent && sub_bus) {
pdn->bussubno); u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, *sub_bus);
int err; int err;
err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno, err = HvCallXm_connectBusUnit(pdn->busno, *sub_bus,
*agent, irq); *agent, irq);
if (err) if (err)
pci_log_error("Connect Bus Unit", pci_log_error("Connect Bus Unit",
pdn->busno, pdn->bussubno, *agent, err); pdn->busno, *sub_bus, *agent, err);
else { else {
err = HvCallPci_configStore8(pdn->busno, err = HvCallPci_configStore8(pdn->busno,
pdn->bussubno, *agent, *sub_bus, *agent,
PCI_INTERRUPT_LINE, irq); PCI_INTERRUPT_LINE, irq);
if (err) if (err)
pci_log_error("PciCfgStore Irq Failed!", pci_log_error("PciCfgStore Irq Failed!",
pdn->busno, pdn->bussubno, pdn->busno, *sub_bus,
*agent, err); *agent, err);
else else
pdev->irq = irq; pdev->irq = irq;
@ -229,8 +230,7 @@ void __init iSeries_pci_final_fixup(void)
pdev->sysdata = node; pdev->sysdata = node;
PCI_DN(node)->pcidev = pdev; PCI_DN(node)->pcidev = pdev;
allocate_device_bars(pdev); allocate_device_bars(pdev);
iSeries_Device_Information(pdev, num_dev, pdn->busno, iSeries_Device_Information(pdev, num_dev, pdn->busno, *sub_bus);
pdn->bussubno);
iommu_devnode_init_iSeries(pdev, node); iommu_devnode_init_iSeries(pdev, node);
} }
iSeries_activate_IRQs(); iSeries_activate_IRQs();