[POWERPC] iSeries: Unindent and clean iSeries_pci_final_fixup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, January 30, 2008 - 7:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f1786...
Commit:     3f1786328a1c5f6240d96ca6359246c4bded7ec3
Parent:     6a9057933421126ef8265c15b8220c015865b1eb
Author:     Stephen Rothwell <sfr@canb.auug.org.au>
AuthorDate: Fri Dec 7 01:51:48 2007 +1100
Committer:  Paul Mackerras <paulus@samba.org>
CommitDate: Tue Dec 11 13:42:22 2007 +1100

    [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>
---
 arch/powerpc/platforms/iseries/pci.c |   68 +++++++++++++++++----------------
 1 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index cff832a..8e2ac3d 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)
 
 	printk("pcibios_final_fixup\n");
 	for_each_pci_dev(pdev) {
+		struct pci_dn *pdn;
+		const u32 *agent;
+
 		node = find_device_node(pdev->bus->number, pdev->devfn);
 		printk("pci dev %p (%x.%x), node %p\n", pdev,
 		       pdev->bus->number, pdev->devfn, node);
+		if (!node) {
+			printk("PCI: Device Tree not found for 0x%016lX\n",
+					(unsigned long)pdev);
+			continue;
+		}
 
-		if (node != NULL) {
-			struct pci_dn *pdn = PCI_DN(node);
-			const u32 *agent;
-
-			agent = of_get_property(node, "linux,agent-id", NULL);
-			if ((pdn != NULL) && (agent != NULL)) {
-				u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
-						pdn->bussubno);
-				int err;
-
-				err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
-						*agent, irq);
+		pdn = PCI_DN(node);
+		agent = of_get_property(node, "linux,agent-id", NULL);
+		if (pdn && agent) {
+			u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
+					pdn->bussubno);
+			int err;
+
+			err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
+					*agent, irq);
+			if (err)
+				pci_log_error("Connect Bus Unit",
+					pdn->busno, pdn->bussubno, *agent, err);
+			else {
+				err = HvCallPci_configStore8(pdn->busno,
+					pdn->bussubno, *agent,
+					PCI_INTERRUPT_LINE, irq);
 				if (err)
-					pci_log_error("Connect Bus Unit",
-						pdn->busno, pdn->bussubno, *agent, err);
-				else {
-					err = HvCallPci_configStore8(pdn->busno, pdn->bussubno,
-							*agent,
-							PCI_INTERRUPT_LINE,
-							irq);
-					if (err)
-						pci_log_error("PciCfgStore Irq Failed!",
-							pdn->busno, pdn->bussubno, *agent, err);
-				}
-				if (!err)
+					pci_log_error("PciCfgStore Irq Failed!",
+						pdn->busno, pdn->bussubno,
+						*agent, err);
+				else
 					pdev->irq = irq;
 			}
+		}
 
-			++num_dev;
-			pdev->sysdata = node;
-			PCI_DN(node)->pcidev = pdev;
-			allocate_device_bars(pdev);
-			iSeries_Device_Information(pdev, num_dev);
-			iommu_devnode_init_iSeries(pdev, node);
-		} else
-			printk("PCI: Device Tree not found for 0x%016lX\n",
-					(unsigned long)pdev);
+		num_dev++;
+		pdev->sysdata = node;
+		PCI_DN(node)->pcidev = pdev;
+		allocate_device_bars(pdev);
+		iSeries_Device_Information(pdev, num_dev);
+		iommu_devnode_init_iSeries(pdev, node);
 	}
 	iSeries_activate_IRQs();
 	mf_display_src(0xC9000200);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[POWERPC] iSeries: Unindent and clean iSeries_pci_final_fixup, Linux Kernel Mailing ..., (Wed Jan 30, 7:59 pm)