patch-2.4.17 linux/drivers/char/agp/agpgart_be.c
Next file: linux/drivers/char/console.c
Previous file: linux/drivers/block/rd.c
Back to the patch index
Back to the overall index
- Lines: 58
- Date:
Fri Dec 21 16:40:32 2001
- Orig file:
linux-2.4.16/drivers/char/agp/agpgart_be.c
- Orig date:
Fri Nov 16 18:11:22 2001
diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.16/drivers/char/agp/agpgart_be.c linux/drivers/char/agp/agpgart_be.c
@@ -409,8 +409,18 @@
* AGP devices and collect their data.
*/
- 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))
@@ -3242,8 +3252,18 @@
* AGP devices and collect their data.
*/
- 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))
@@ -3877,12 +3897,10 @@
case PCI_DEVICE_ID_INTEL_830_M_0:
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
- PCI_DEVICE_ID_INTEL_830_M_1,
- NULL);
- if(PCI_FUNC(i810_dev->devfn) != 0) {
+ PCI_DEVICE_ID_INTEL_830_M_1, NULL);
+ if(i810_dev && PCI_FUNC(i810_dev->devfn) != 0) {
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
- PCI_DEVICE_ID_INTEL_830_M_1,
- i810_dev);
+ PCI_DEVICE_ID_INTEL_830_M_1, i810_dev);
}
if (i810_dev == NULL) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)