aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/pci.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-12-06 09:51:48 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-10 21:42:22 -0500
commit3f1786328a1c5f6240d96ca6359246c4bded7ec3 (patch)
tree1ff02b62315bbb619c88996d1572e5177abb985a /arch/powerpc/platforms/iseries/pci.c
parent6a9057933421126ef8265c15b8220c015865b1eb (diff)
[POWERPC] iSeries: Unindent and clean iSeries_pci_final_fixup
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/pci.c')
-rw-r--r--arch/powerpc/platforms/iseries/pci.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index cff832a64e1f..8e2ac3d0c81a 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -177,47 +177,49 @@ void __init iSeries_pci_final_fixup(void)
177 177
178 printk("pcibios_final_fixup\n"); 178 printk("pcibios_final_fixup\n");
179 for_each_pci_dev(pdev) { 179 for_each_pci_dev(pdev) {
180 struct pci_dn *pdn;
181 const u32 *agent;
182
180 node = find_device_node(pdev->bus->number, pdev->devfn); 183 node = find_device_node(pdev->bus->number, pdev->devfn);
181 printk("pci dev %p (%x.%x), node %p\n", pdev, 184 printk("pci dev %p (%x.%x), node %p\n", pdev,
182 pdev->bus->number, pdev->devfn, node); 185 pdev->bus->number, pdev->devfn, node);
186 if (!node) {
187 printk("PCI: Device Tree not found for 0x%016lX\n",
188 (unsigned long)pdev);
189 continue;
190 }
183 191
184 if (node != NULL) { 192 pdn = PCI_DN(node);
185 struct pci_dn *pdn = PCI_DN(node); 193 agent = of_get_property(node, "linux,agent-id", NULL);
186 const u32 *agent; 194 if (pdn && agent) {
187 195 u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
188 agent = of_get_property(node, "linux,agent-id", NULL); 196 pdn->bussubno);
189 if ((pdn != NULL) && (agent != NULL)) { 197 int err;
190 u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, 198
191 pdn->bussubno); 199 err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
192 int err; 200 *agent, irq);
193 201 if (err)
194 err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno, 202 pci_log_error("Connect Bus Unit",
195 *agent, irq); 203 pdn->busno, pdn->bussubno, *agent, err);
204 else {
205 err = HvCallPci_configStore8(pdn->busno,
206 pdn->bussubno, *agent,
207 PCI_INTERRUPT_LINE, irq);
196 if (err) 208 if (err)
197 pci_log_error("Connect Bus Unit", 209 pci_log_error("PciCfgStore Irq Failed!",
198 pdn->busno, pdn->bussubno, *agent, err); 210 pdn->busno, pdn->bussubno,
199 else { 211 *agent, err);
200 err = HvCallPci_configStore8(pdn->busno, pdn->bussubno, 212 else
201 *agent,
202 PCI_INTERRUPT_LINE,
203 irq);
204 if (err)
205 pci_log_error("PciCfgStore Irq Failed!",
206 pdn->busno, pdn->bussubno, *agent, err);
207 }
208 if (!err)
209 pdev->irq = irq; 213 pdev->irq = irq;
210 } 214 }
215 }
211 216
212 ++num_dev; 217 num_dev++;
213 pdev->sysdata = node; 218 pdev->sysdata = node;
214 PCI_DN(node)->pcidev = pdev; 219 PCI_DN(node)->pcidev = pdev;
215 allocate_device_bars(pdev); 220 allocate_device_bars(pdev);
216 iSeries_Device_Information(pdev, num_dev); 221 iSeries_Device_Information(pdev, num_dev);
217 iommu_devnode_init_iSeries(pdev, node); 222 iommu_devnode_init_iSeries(pdev, node);
218 } else
219 printk("PCI: Device Tree not found for 0x%016lX\n",
220 (unsigned long)pdev);
221 } 223 }
222 iSeries_activate_IRQs(); 224 iSeries_activate_IRQs();
223 mf_display_src(0xC9000200); 225 mf_display_src(0xC9000200);