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

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

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/scsi/eata_pio.c linux/drivers/scsi/eata_pio.c
@@ -878,19 +878,21 @@
 #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;
 
-    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_pio: 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_pio: invalid base address of device %s\n", dev->name);
 		continue;
 	    }
-	    base = dev->resource[0].start;
+	    base = pci_resource_start(dev, 0);
             /* EISA tag there ? */
 	    if ((inb(base) == 0x12) && (inb(base + 1) == 0x14))
 		continue;   /* Jep, it's forced, so move on  */

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