Convert to pci_resource_start()
authorDavid Schleef <ds@schleef.org>
Sun, 10 Feb 2002 05:05:07 +0000 (05:05 +0000)
committerDavid Schleef <ds@schleef.org>
Sun, 10 Feb 2002 05:05:07 +0000 (05:05 +0000)
comedi/drivers/cb_pcidda.c
comedi/drivers/daqboard2000.c
comedi/drivers/dt3000.c

index 1627c2fed6cc17cbd9584dcd40429951af3834f9..80a29e8bf9630c77f386c3df49aa192edc9206d8 100644 (file)
@@ -71,11 +71,11 @@ PLEASE REPORT IF YOU ARE USING IT WITH A DIFFERENT CARD
 
 /* PCI-DDA base addresses */
 #define DIGITALIO_BADRINDEX    2
-       // DIGITAL I/O is devpriv->pci_dev->base_address[2]
+       // DIGITAL I/O is pci_dev->resource[2]
 #define DIGITALIO_SIZE 8
        // DIGITAL I/O uses 8 I/O port addresses
 #define DAC_BADRINDEX  3
-       // DAC is devpriv->pci_dev->base_address[3]
+       // DAC is pci_dev->resource[3]
 
 /* Digital I/O registers */
 #define PORT1A 0       // PORT 1A DATA
index 1d78e063c1da9a4e2f1d9c829c7ef66a70e51560..fc675ee4551bb33f969cedf72dae27fa93a3406a 100644 (file)
@@ -745,13 +745,8 @@ static int daqboard2000_attach(comedi_device *dev, comedi_devconfig *it)
   result = alloc_subdevices(dev);
   if(result<0)goto out;
   
-#if LINUX_VERSION_CODE < 0x020300
-  devpriv->plx = ioremap(card->base_address[0], DAQBOARD2000_PLX_SIZE);
-  devpriv->daq = ioremap(card->base_address[2], DAQBOARD2000_DAQ_SIZE);
-#else
-  devpriv->plx = ioremap(card->resource[0].start, DAQBOARD2000_PLX_SIZE);
-  devpriv->daq = ioremap(card->resource[2].start, DAQBOARD2000_DAQ_SIZE);
-#endif
+  devpriv->plx = ioremap(pci_resource_start(card,0), DAQBOARD2000_PLX_SIZE);
+  devpriv->daq = ioremap(pci_resource_start(card,2), DAQBOARD2000_DAQ_SIZE);
   readl(devpriv->plx + 0x6c); 
 
   /*
index fc1d020ef94b036b8993c637fa6796e668941c4e..74d29c17b0868bda0be1f3a18962ef255254693d 100644 (file)
@@ -571,11 +571,7 @@ static int setup_pci(comedi_device *dev)
        ret = pci_enable_device(devpriv->pci_dev);
        if(ret<0)return ret;
 
-#if LINUX_VERSION_CODE < 0x020300
-       addr=devpriv->pci_dev->base_address[0];
-#else
-       addr=devpriv->pci_dev->resource[0].start;
-#endif
+       addr=pci_resource_start(devpriv->pci_dev,0);
        devpriv->phys_addr=addr;
        offset = devpriv->phys_addr & ~PAGE_MASK;
        devpriv->io_addr = ioremap(devpriv->phys_addr & PAGE_MASK, DT3000_SIZE + offset )