diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 15:07:04 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-19 10:17:22 -0500 |
commit | 9e808eb6a7689b61399f772a2576d779161769ec (patch) | |
tree | 73af8c5605ba91394b1fffdc964a03741b4897c4 /arch/sparc | |
parent | a0c8a4d9f92d1ecd053eaa0e6cde7b4f24af97a8 (diff) | |
download | op-kernel-dev-9e808eb6a7689b61399f772a2576d779161769ec.zip op-kernel-dev-9e808eb6a7689b61399f772a2576d779161769ec.tar.gz |
PCI: Cleanup control flow
Return errors immediately so the straightline path is the normal,
no-error path. No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/leon_pci.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index 2971076..4371f72 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c @@ -34,16 +34,17 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) root_bus = pci_scan_root_bus(&ofdev->dev, 0, info->ops, info, &resources); - if (root_bus) { - /* Setup IRQs of all devices using custom routines */ - pci_fixup_irqs(pci_common_swizzle, info->map_irq); - - /* Assign devices with resources */ - pci_assign_unassigned_resources(); - pci_bus_add_devices(root_bus); - } else { + if (!root_bus) { pci_free_resource_list(&resources); + return; } + + /* Setup IRQs of all devices using custom routines */ + pci_fixup_irqs(pci_common_swizzle, info->map_irq); + + /* Assign devices with resources */ + pci_assign_unassigned_resources(); + pci_bus_add_devices(root_bus); } void pcibios_fixup_bus(struct pci_bus *pbus) |