aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/pci/i386.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index b73c09f45210..5dc9e8c63fcd 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -146,16 +146,29 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
146 } 146 }
147} 147}
148 148
149struct pci_check_idx_range {
150 int start;
151 int end;
152};
153
149static void __init pcibios_allocate_resources(int pass) 154static void __init pcibios_allocate_resources(int pass)
150{ 155{
151 struct pci_dev *dev = NULL; 156 struct pci_dev *dev = NULL;
152 int idx, disabled; 157 int idx, disabled, i;
153 u16 command; 158 u16 command;
154 struct resource *r; 159 struct resource *r;
155 160
161 struct pci_check_idx_range idx_range[] = {
162 { PCI_STD_RESOURCES, PCI_STD_RESOURCE_END },
163#ifdef CONFIG_PCI_IOV
164 { PCI_IOV_RESOURCES, PCI_IOV_RESOURCE_END },
165#endif
166 };
167
156 for_each_pci_dev(dev) { 168 for_each_pci_dev(dev) {
157 pci_read_config_word(dev, PCI_COMMAND, &command); 169 pci_read_config_word(dev, PCI_COMMAND, &command);
158 for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) { 170 for (i = 0; i < ARRAY_SIZE(idx_range); i++)
171 for (idx = idx_range[i].start; idx <= idx_range[i].end; idx++) {
159 r = &dev->resource[idx]; 172 r = &dev->resource[idx];
160 if (r->parent) /* Already allocated */ 173 if (r->parent) /* Already allocated */
161 continue; 174 continue;