diff -u -X /home/helgaas/exclude -r linux-2.4.18-pre6/drivers/char/agp/agpgart_be.c build/linux-2.4.18-pre6/drivers/char/agp/agpgart_be.c --- linux-2.4.18-pre6/drivers/char/agp/agpgart_be.c Wed Jan 23 10:16:39 2002 +++ build/linux-2.4.18-pre6/drivers/char/agp/agpgart_be.c Wed Jan 23 10:23:23 2002 @@ -506,8 +506,17 @@ * command registers. */ - while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, - device)) != NULL) { + pci_for_each_dev(device) + { + /* + * Enable AGP devices. Most will be VGA display but + * some may be coprocessors on non VGA devices too + */ + + if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) && + (device->class != (PCI_CLASS_PROCESSOR_CO << 8))) + continue; + pci_read_config_dword(device, 0x04, &scratch); if (!(scratch & 0x00100000)) @@ -3421,8 +3430,17 @@ * command registers. */ - while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, - device)) != NULL) { + pci_for_each_dev(device) + { + /* + * Enable AGP devices. Most will be VGA display but + * some may be coprocessors on non VGA devices too + */ + + if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) && + (device->class != (PCI_CLASS_PROCESSOR_CO << 8))) + continue; + pci_read_config_dword(device, 0x04, &scratch); if (!(scratch & 0x00100000))