diff options
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 2a4779091a58..155013da27e0 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -208,7 +208,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
208 | unsigned long in_devfn) | 208 | unsigned long in_devfn) |
209 | { | 209 | { |
210 | struct pci_controller* hose; | 210 | struct pci_controller* hose; |
211 | struct pci_bus *bus = NULL; | 211 | struct pci_bus *tmp_bus, *bus = NULL; |
212 | struct device_node *hose_node; | 212 | struct device_node *hose_node; |
213 | 213 | ||
214 | /* Argh ! Please forgive me for that hack, but that's the | 214 | /* Argh ! Please forgive me for that hack, but that's the |
@@ -229,10 +229,12 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
229 | * used on pre-domains setup. We return the first match | 229 | * used on pre-domains setup. We return the first match |
230 | */ | 230 | */ |
231 | 231 | ||
232 | list_for_each_entry(bus, &pci_root_buses, node) { | 232 | list_for_each_entry(tmp_bus, &pci_root_buses, node) { |
233 | if (in_bus >= bus->number && in_bus <= bus->busn_res.end) | 233 | if (in_bus >= tmp_bus->number && |
234 | in_bus <= tmp_bus->busn_res.end) { | ||
235 | bus = tmp_bus; | ||
234 | break; | 236 | break; |
235 | bus = NULL; | 237 | } |
236 | } | 238 | } |
237 | if (bus == NULL || bus->dev.of_node == NULL) | 239 | if (bus == NULL || bus->dev.of_node == NULL) |
238 | return -ENODEV; | 240 | return -ENODEV; |