diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 16:07:04 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-19 11:17:22 -0400 |
commit | 9e808eb6a7689b61399f772a2576d779161769ec (patch) | |
tree | 73af8c5605ba91394b1fffdc964a03741b4897c4 /arch/mips/pci/pci.c | |
parent | a0c8a4d9f92d1ecd053eaa0e6cde7b4f24af97a8 (diff) |
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/mips/pci/pci.c')
-rw-r--r-- | arch/mips/pci/pci.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 9eb54b557c9f..8bb13a4af68a 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -94,28 +94,29 @@ static void pcibios_scanbus(struct pci_controller *hose) | |||
94 | pci_add_resource_offset(&resources, hose->io_resource, hose->io_offset); | 94 | pci_add_resource_offset(&resources, hose->io_resource, hose->io_offset); |
95 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, | 95 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, |
96 | &resources); | 96 | &resources); |
97 | if (!bus) | ||
98 | pci_free_resource_list(&resources); | ||
99 | |||
100 | hose->bus = bus; | 97 | hose->bus = bus; |
101 | 98 | ||
102 | need_domain_info = need_domain_info || hose->index; | 99 | need_domain_info = need_domain_info || hose->index; |
103 | hose->need_domain_info = need_domain_info; | 100 | hose->need_domain_info = need_domain_info; |
104 | if (bus) { | ||
105 | next_busno = bus->busn_res.end + 1; | ||
106 | /* Don't allow 8-bit bus number overflow inside the hose - | ||
107 | reserve some space for bridges. */ | ||
108 | if (next_busno > 224) { | ||
109 | next_busno = 0; | ||
110 | need_domain_info = 1; | ||
111 | } | ||
112 | 101 | ||
113 | if (!pci_has_flag(PCI_PROBE_ONLY)) { | 102 | if (!bus) { |
114 | pci_bus_size_bridges(bus); | 103 | pci_free_resource_list(&resources); |
115 | pci_bus_assign_resources(bus); | 104 | return; |
116 | } | 105 | } |
117 | pci_bus_add_devices(bus); | 106 | |
107 | next_busno = bus->busn_res.end + 1; | ||
108 | /* Don't allow 8-bit bus number overflow inside the hose - | ||
109 | reserve some space for bridges. */ | ||
110 | if (next_busno > 224) { | ||
111 | next_busno = 0; | ||
112 | need_domain_info = 1; | ||
113 | } | ||
114 | |||
115 | if (!pci_has_flag(PCI_PROBE_ONLY)) { | ||
116 | pci_bus_size_bridges(bus); | ||
117 | pci_bus_assign_resources(bus); | ||
118 | } | 118 | } |
119 | pci_bus_add_devices(bus); | ||
119 | } | 120 | } |
120 | 121 | ||
121 | #ifdef CONFIG_OF | 122 | #ifdef CONFIG_OF |