diff options
Diffstat (limited to 'arch/mips/pci/pci.c')
-rw-r--r-- | arch/mips/pci/pci.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index a1843448fad3..0872f12f268d 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * This program is free software; you can redistribute it and/or modify it | 2 | * This program is free software; you can redistribute it and/or modify it |
3 | * under the terms of the GNU General Public License as published by the | 3 | * under the terms of the GNU General Public License as published by the |
4 | * Free Software Foundation; either version 2 of the License, or (at your | 4 | * Free Software Foundation; either version 2 of the License, or (at your |
5 | * option) any later version. | 5 | * option) any later version. |
6 | * | 6 | * |
@@ -175,9 +175,20 @@ static DEFINE_MUTEX(pci_scan_mutex); | |||
175 | 175 | ||
176 | void register_pci_controller(struct pci_controller *hose) | 176 | void register_pci_controller(struct pci_controller *hose) |
177 | { | 177 | { |
178 | if (request_resource(&iomem_resource, hose->mem_resource) < 0) | 178 | struct resource *parent; |
179 | |||
180 | parent = hose->mem_resource->parent; | ||
181 | if (!parent) | ||
182 | parent = &iomem_resource; | ||
183 | |||
184 | if (request_resource(parent, hose->mem_resource) < 0) | ||
179 | goto out; | 185 | goto out; |
180 | if (request_resource(&ioport_resource, hose->io_resource) < 0) { | 186 | |
187 | parent = hose->io_resource->parent; | ||
188 | if (!parent) | ||
189 | parent = &ioport_resource; | ||
190 | |||
191 | if (request_resource(parent, hose->io_resource) < 0) { | ||
181 | release_resource(hose->mem_resource); | 192 | release_resource(hose->mem_resource); |
182 | goto out; | 193 | goto out; |
183 | } | 194 | } |