vserver 2.0 rc7
[linux-2.6.git] / arch / i386 / pci / i386.c
index 7a7b35a..c205ea7 100644 (file)
@@ -124,7 +124,7 @@ static void __init pcibios_allocate_resources(int pass)
        u16 command;
        struct resource *r, *pr;
 
-       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       for_each_pci_dev(dev) {
                pci_read_config_word(dev, PCI_COMMAND, &command);
                for(idx = 0; idx < 6; idx++) {
                        r = &dev->resource[idx];
@@ -150,11 +150,11 @@ static void __init pcibios_allocate_resources(int pass)
                }
                if (!pass) {
                        r = &dev->resource[PCI_ROM_RESOURCE];
-                       if (r->flags & PCI_ROM_ADDRESS_ENABLE) {
+                       if (r->flags & IORESOURCE_ROM_ENABLE) {
                                /* Turn the ROM off, leave the resource region, but keep it unregistered. */
                                u32 reg;
                                DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
-                               r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
+                               r->flags &= ~IORESOURCE_ROM_ENABLE;
                                pci_read_config_dword(dev, dev->rom_base_reg, &reg);
                                pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE);
                        }
@@ -168,7 +168,7 @@ static int __init pcibios_assign_resources(void)
        int idx;
        struct resource *r;
 
-       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       for_each_pci_dev(dev) {
                int class = dev->class >> 8;
 
                /* Don't touch classless devices and host bridges */