aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/pci/i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/pci/i386.c')
-rw-r--r--arch/i386/pci/i386.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index c205ea7e233b..93a364c82150 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -106,11 +106,16 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
106 if ((dev = bus->self)) { 106 if ((dev = bus->self)) {
107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
108 r = &dev->resource[idx]; 108 r = &dev->resource[idx];
109 if (!r->start) 109 if (!r->flags)
110 continue; 110 continue;
111 pr = pci_find_parent_resource(dev, r); 111 pr = pci_find_parent_resource(dev, r);
112 if (!pr || request_resource(pr, r) < 0) 112 if (!r->start || !pr || request_resource(pr, r) < 0) {
113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); 113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
114 /* Something is wrong with the region.
115 Invalidate the resource to prevent child
116 resource allocations in this range. */
117 r->flags = 0;
118 }
114 } 119 }
115 } 120 }
116 pcibios_allocate_bus_resources(&bus->children); 121 pcibios_allocate_bus_resources(&bus->children);
@@ -227,7 +232,7 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
227 232
228 pci_read_config_word(dev, PCI_COMMAND, &cmd); 233 pci_read_config_word(dev, PCI_COMMAND, &cmd);
229 old_cmd = cmd; 234 old_cmd = cmd;
230 for(idx=0; idx<6; idx++) { 235 for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
231 /* Only set up the requested stuff */ 236 /* Only set up the requested stuff */
232 if (!(mask & (1<<idx))) 237 if (!(mask & (1<<idx)))
233 continue; 238 continue;