diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 21:07:04 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-19 16:17:22 +0100 |
commit | 9e808eb6a7689b61399f772a2576d779161769ec (patch) | |
tree | 73af8c5605ba91394b1fffdc964a03741b4897c4 /arch/sh/drivers | |
parent | sparc/PCI: Claim bus resources before pci_bus_add_devices() (diff) | |
download | linux-9e808eb6a7689b61399f772a2576d779161769ec.tar.xz linux-9e808eb6a7689b61399f772a2576d779161769ec.zip |
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/sh/drivers')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index efc10519916a..d5462b7bc514 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -58,21 +58,23 @@ static void pcibios_scanbus(struct pci_channel *hose) need_domain_info = need_domain_info || hose->index; hose->need_domain_info = need_domain_info; - if (bus) { - next_busno = bus->busn_res.end + 1; - /* Don't allow 8-bit bus number overflow inside the hose - - reserve some space for bridges. */ - if (next_busno > 224) { - next_busno = 0; - need_domain_info = 1; - } - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - pci_bus_add_devices(bus); - } else { + if (!bus) { pci_free_resource_list(&resources); + return; + } + + next_busno = bus->busn_res.end + 1; + /* Don't allow 8-bit bus number overflow inside the hose - + reserve some space for bridges. */ + if (next_busno > 224) { + next_busno = 0; + need_domain_info = 1; } + + pci_bus_size_bridges(bus); + pci_bus_assign_resources(bus); + pci_bus_add_devices(bus); } /* |