patch-2.4.0-test2 linux/drivers/scsi/eata_dma.c

Next file: linux/drivers/scsi/eata_pio.c
Previous file: linux/drivers/scsi/eata.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/scsi/eata_dma.c linux/drivers/scsi/eata_dma.c
@@ -1388,20 +1388,22 @@
 #ifndef CONFIG_PCI
     printk("eata_dma: kernel PCI support not enabled. Skipping scan for PCI HBAs.\n");
 #else
-    struct pci_dev *dev; 
+    struct pci_dev *dev = NULL; 
     u32 base, x;
     u8 pal1, pal2, pal3;
 
-    for(dev=NULL; dev = pci_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, dev);) {
+    while ((dev = pci_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, dev)) != NULL) {
 	    DBG(DBG_PROBE && DBG_PCI, 
 		printk("eata_dma: find_PCI, HBA at %s\n", dev->name));
+	    if (pci_enable_device(dev))
+	    	continue;
 	    pci_set_master(dev);
-	    base = dev->resource[0].flags;
-	    if (!(base & PCI_BASE_ADDRESS_SPACE_IO)) {
+	    base = pci_resource_flags(dev, 0);
+	    if (base & IORESOURCE_MEM) {
 		printk("eata_dma: invalid base address of device %s\n", dev->name);
 		continue;
 	    }
-	    base = dev->resource[0].start;
+	    base = pci_resource_start(dev, 0);
             /* EISA tag there ? */
 	    pal1 = inb(base);
 	    pal2 = inb(base + 1);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)