diff options
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1ba84be0b4c0..c1bdfb424658 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -72,7 +72,10 @@ pbus_assign_resources_sorted(struct pci_bus *bus) | |||
72 | for (list = head.next; list;) { | 72 | for (list = head.next; list;) { |
73 | res = list->res; | 73 | res = list->res; |
74 | idx = res - &list->dev->resource[0]; | 74 | idx = res - &list->dev->resource[0]; |
75 | pci_assign_resource(list->dev, idx); | 75 | if (pci_assign_resource(list->dev, idx)) { |
76 | res->start = 0; | ||
77 | res->flags = 0; | ||
78 | } | ||
76 | tmp = list; | 79 | tmp = list; |
77 | list = list->next; | 80 | list = list->next; |
78 | kfree(tmp); | 81 | kfree(tmp); |
@@ -270,6 +273,8 @@ find_free_bus_resource(struct pci_bus *bus, unsigned long type) | |||
270 | 273 | ||
271 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | 274 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { |
272 | r = bus->resource[i]; | 275 | r = bus->resource[i]; |
276 | if (r == &ioport_resource || r == &iomem_resource) | ||
277 | continue; | ||
273 | if (r && (r->flags & type_mask) == type && !r->parent) | 278 | if (r && (r->flags & type_mask) == type && !r->parent) |
274 | return r; | 279 | return r; |
275 | } | 280 | } |