removed dev->iosize
authorDavid Schleef <ds@schleef.org>
Thu, 22 Mar 2001 00:02:37 +0000 (00:02 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 22 Mar 2001 00:02:37 +0000 (00:02 +0000)
20 files changed:
comedi/drivers/adl_pci9118.c
comedi/drivers/comedi_parport.c
comedi/drivers/das08.c
comedi/drivers/das1800.c
comedi/drivers/das800.c
comedi/drivers/dt2811.c
comedi/drivers/dt2814.c
comedi/drivers/dt2817.c
comedi/drivers/dt282x.c
comedi/drivers/multiq3.c
comedi/drivers/ni_atmio.c
comedi/drivers/ni_atmio16d.c
comedi/drivers/pcl711.c
comedi/drivers/pcl724.c
comedi/drivers/pcl725.c
comedi/drivers/pcl726.c
comedi/drivers/pcl812.c
comedi/drivers/pcl818.c
comedi/drivers/poc.c
comedi/drivers/rti800.c

index 31bf1ef837e1f880fb3e8a0a0310f4c88aa9ca58..6ff3a128309a929c82043d9a8c83d58879a63595 100644 (file)
@@ -1283,8 +1283,7 @@ static int pci9118_attach(comedi_device *dev,comedi_devconfig *it)
         }
 
         dev->iobase=iobase_9;
-        dev->iosize=this_board->iorange_9118;
-        request_region(dev->iobase, dev->iosize, "ADLink PCI-9118");
+        request_region(dev->iobase, this_board->iorange_9118, "ADLink PCI-9118");
 
        dev->board_name = this_board->name;
 
@@ -1450,7 +1449,9 @@ static int pci9118_detach(comedi_device *dev)
                free_irq(dev->irq,dev);
        }
 
-       release_region(dev->iobase,dev->iosize);
+       if(dev->iobase){
+               release_region(dev->iobase, this_board->iorange_9118);
+       }
 
        return 0;
 }
index e5c43053251fc102a5b53ce9831ef3969f12dae1..fcf2807f0db3ee3ca11d2f12413853f1a023bdf3 100644 (file)
@@ -59,6 +59,8 @@ comedi_driver driver_parport={
        attach:         parport_attach,
        detach:         parport_detach,
 };
+COMEDI_INITCLEANUP(driver_parport);
+
 
 typedef struct parport_private_struct{
        unsigned int a_data;
@@ -241,7 +243,6 @@ static int parport_attach(comedi_device *dev,comedi_devconfig *it)
        }
        request_region(iobase,PARPORT_SIZE,"parport (comedi)");
        dev->iobase=iobase;
-       dev->iosize=PARPORT_SIZE;
 
        irq=it->options[1];
        if(irq){
@@ -316,12 +317,10 @@ static int parport_detach(comedi_device *dev)
 {
        printk("comedi%d: parport: remove\n",dev->minor);
        
-       if(dev->iobase)release_region(dev->iobase,dev->iosize);
+       if(dev->iobase)release_region(dev->iobase,PARPORT_SIZE);
 
        if(dev->irq)comedi_free_irq(dev->irq,dev);
 
        return 0;
 }
 
-COMEDI_INITCLEANUP(driver_parport);
-
index 47cce6aa9c2d9808d1395bea61ac36fd8e175675..ee49bd7847758f7c41562581b71dda47b79cb310 100644 (file)
@@ -513,7 +513,6 @@ static int das08_attach(comedi_device *dev,comedi_devconfig *it)
        }
 
        dev->board_name = thisboard->name;
-       dev->iosize = DAS08_SIZE;
 
        dev->n_subdevices=5;
        if((ret=alloc_subdevices(dev))<0)
index 81cf3bdd2fe013f223e30324617f98ac9abda75f..747e817d7d269b5ba87fda82173d37fd6ea59701 100644 (file)
@@ -524,7 +524,6 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it)
        }
        request_region(iobase, DAS1800_SIZE, "das1800");
        dev->iobase = iobase;
-       dev->iosize = DAS1800_SIZE;
 
        board = das1800_probe(dev);
        if(board < 0)
index 652a9a4f79a2c64da7cc530c873a5600de1933a9..6142c845e6fac509da90a05ceac5ac9ebb1555cd 100644 (file)
@@ -419,7 +419,6 @@ static int das800_attach(comedi_device *dev, comedi_devconfig *it)
        }
        request_region(iobase, DAS800_SIZE, "das800");
        dev->iobase = iobase;
-       dev->iosize = DAS800_SIZE;
 
        board = das800_probe(dev);
        if(board < 0)
index 0586f76c80d448ef2007601044eacbf24f97c0f7..d77481f1ea0752d5811545182d5602837ba6704b 100644 (file)
@@ -294,7 +294,6 @@ static int dt2811_attach(comedi_device * dev, comedi_devconfig * it)
        request_region(dev->iobase, DT2811_SIZE, driver_name);
 
        dev->board_name = this_board->name;
-       dev->iosize = DT2811_SIZE;
 
 #if 0
        outb(0, dev->iobase + DT2811_ADCSR);
@@ -424,7 +423,9 @@ static int dt2811_detach(comedi_device * dev)
        if (dev->irq) {
                free_irq(dev->irq, dev);
        }
-       release_region(dev->iobase, dev->iosize);
+       if(dev->iobase){
+               release_region(dev->iobase, DT2811_SIZE);
+       }
 
        return 0;
 }
index 651c6fc3ef61595c83a0b9a08816be659c9a3274..98ca568eb26f250013625778766942cbf14715aa 100644 (file)
@@ -239,7 +239,6 @@ static int dt2814_attach(comedi_device *dev,comedi_devconfig *it)
        }
        request_region(dev->iobase,DT2814_SIZE,"dt2814");
        dev->iobase=dev->iobase;
-       dev->iosize=DT2814_SIZE;
        dev->board_name = "dt2814";
 
        outb(0,dev->iobase+DT2814_CSR);
@@ -313,7 +312,7 @@ static int dt2814_detach(comedi_device *dev)
                free_irq(dev->irq,dev);
        }
        if(dev->iobase){
-               release_region(dev->iobase,dev->iosize);
+               release_region(dev->iobase,DT2814_SIZE);
        }
 
        return 0;
index bdfa7f17cf3633ce2278a38b19f06a51337ce77c..a7b7d7c2c6993924ce8dbc80c7fd97db952357ba 100644 (file)
@@ -129,7 +129,6 @@ static int dt2817_attach(comedi_device *dev,comedi_devconfig *it)
        }
        request_region(dev->iobase,DT2817_SIZE,"dt2817");
        dev->board_name="dt2817";
-       dev->iosize=DT2817_SIZE;
 
        dev->n_subdevices=1;
        if((ret=alloc_subdevices(dev))<0)
@@ -158,7 +157,8 @@ static int dt2817_detach(comedi_device *dev)
 {
        printk("comedi%d: dt2817: remove\n",dev->minor);
        
-       release_region(dev->iobase,dev->iosize);
+       if(dev->iobase)
+               release_region(dev->iobase,DT2817_SIZE);
 
        return 0;
 }
index 7b8845d915d124be6ce563e2e768329bd44551a3..a84ed163c82e424f01d0d2995513cbc5cda5fb7d 100644 (file)
@@ -1156,7 +1156,6 @@ static int dt282x_attach(comedi_device * dev, comedi_devconfig * it)
                return -EBUSY;
        }
        request_region(dev->iobase, DT2821_SIZE, "dt282x");
-       dev->iosize = DT2821_SIZE;
 
        outw(DT2821_BDINIT, dev->iobase + DT2821_SUPCSR);
        i = inw(dev->iobase + DT2821_ADCSR);
@@ -1286,7 +1285,7 @@ static void free_resources(comedi_device *dev)
                free_irq(dev->irq, dev);
        }
        if(dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, DT2821_SIZE);
        if(dev->private){
                if (devpriv->dma[0].chan)
                        free_dma(devpriv->dma[0].chan);
index fa9c1d19d01a7b8607bfb407c44f0281aafc987f..84787038f9514d03e5ae60a84e11b5c6d7158ce9 100644 (file)
@@ -223,7 +223,6 @@ static int multiq3_attach(comedi_device * dev, comedi_devconfig * it)
 
       request_region(dev->iobase, MULTIQ3_SIZE, "multiq3");
       dev->iobase = iobase;
-      dev->iosize = MULTIQ3_SIZE;
 
       irq = it->options[1];
       if (irq > 0) {
@@ -292,7 +291,7 @@ static int multiq3_detach(comedi_device * dev)
 {
   printk("comedi%d: multiq3: remove\n", dev->minor);
 
-  if (dev->iobase) { release_region(dev->iobase, dev->iosize); }
+  if (dev->iobase) { release_region(dev->iobase, MULTIQ3_SIZE); }
   if (dev->irq) { free_irq(dev->irq,dev); }
 
   return 0;
index 1417780783fbea90f2f0bdffeca0c8d9be92a307..59e4b9ce53fb202500ce7434f419caefcd3c4b02 100644 (file)
@@ -345,7 +345,6 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it)
        request_region(iobase,NI_SIZE,"ni_atmio");
 
        dev->iobase=iobase;
-       dev->iosize=NI_SIZE;
        
 #ifdef DEBUG
        /* board existence sanity check */
index b8ac09d76783cc8054e1ce32c92bcbde3cecb455..9f1b047e43cb8f1925cfd688a4f2042f3d670e2c 100644 (file)
@@ -707,7 +707,6 @@ static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it)
        }
        request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d");
        dev->iobase = iobase;
-       dev->iosize = ATMIO16D_SIZE;
 
        
        /* board name */
@@ -847,7 +846,7 @@ static int atmio16d_detach(comedi_device * dev)
        reset_atmio16d(dev);
        
        if(dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, ATMIO16D_SIZE);
 
        return 0;
 }
index b4d28d5d0159ac8f8ea1448e1c264e3b3ceae823..718cf307b532d5786e9f744e1078d3b788480db1 100644 (file)
@@ -388,7 +388,7 @@ static void free_resources(comedi_device * dev)
                free_irq(dev->irq, dev);
 
        if (dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, PCL711_SIZE);
 }
 
 /*  Initialization */
@@ -409,7 +409,6 @@ static int pcl711_attach(comedi_device * dev, comedi_devconfig * it)
        }
        request_region(dev->iobase, PCL711_SIZE, "pcl711");
        dev->iobase = iobase;
-       dev->iosize = PCL711_SIZE;
 
        /* there should be a sanity check here */
 
index 41d340a675577c394850aa50a7d72fb6bb52cb2e..08f17e85eda3bfaa409711c6e5cec4c8b7fd1c19 100644 (file)
@@ -81,6 +81,7 @@ comedi_driver driver_pcl724={
        num_names:      n_boardtypes,
        offset:         sizeof(boardtype),
 };
+COMEDI_INITCLEANUP(driver_pcl724);
 
 
 static int subdev_8255_cb(int dir,int port,int data,void *arg)
@@ -130,7 +131,6 @@ static int pcl724_attach(comedi_device *dev,comedi_devconfig *it)
        
         request_region(iobase, iorange, "pcl724");
         dev->iobase=iobase;
-        dev->iosize=iorange;
     
        dev->board_name = this_board->name;
 
@@ -188,11 +188,9 @@ static int pcl724_detach(comedi_device *dev)
        }
 #endif
 
-       release_region(dev->iobase,dev->iosize);
+       release_region(dev->iobase,this_board->io_range);
 
        return 0;
 }
 
 
-COMEDI_INITCLEANUP(driver_pcl724);
-
index 874f0500617a898c370bb7cc643cbe117b37f3e0..96599b43f61c13528813b5b5de0efff486caaab0 100644 (file)
@@ -68,7 +68,6 @@ static int pcl725_attach(comedi_device *dev,comedi_devconfig *it)
        request_region(dev->iobase,PCL725_SIZE,"pcl725");
        dev->board_name="pcl725";
        dev->iobase=dev->iobase;
-       dev->iosize=PCL725_SIZE;
        dev->irq=0;
 
        dev->n_subdevices=2;
@@ -104,7 +103,7 @@ static int pcl725_detach(comedi_device *dev)
 {
        printk("comedi%d: pcl725: remove\n",dev->minor);
 
-       if(dev->iobase)release_region(dev->iobase,dev->iosize);
+       if(dev->iobase)release_region(dev->iobase,PCL725_SIZE);
        
        return 0;
 }
index 354f2a2ec7e5f7ed934a26d7cd66788462ec7667..e2ff37c36cfa25411ac1f98e3e684f64320b9636 100644 (file)
@@ -165,6 +165,7 @@ comedi_driver driver_pcl726={
        num_names:      n_boardtypes,
        offset:         sizeof(boardtype),
 };
+COMEDI_INITCLEANUP(driver_pcl726);
 
 typedef struct{
        int bipolar[12];
@@ -227,7 +228,6 @@ static int pcl726_attach(comedi_device *dev,comedi_devconfig *it)
        
         request_region(iobase, iorange, "pcl726");
         dev->iobase=iobase;
-        dev->iosize=iorange;
     
        dev->board_name = this_board->name;
 
@@ -337,11 +337,9 @@ static int pcl726_detach(comedi_device *dev)
        }
 #endif
 
-       release_region(dev->iobase,dev->iosize);
+       release_region(dev->iobase,this_board->io_range);
 
        return 0;
 }
 
 
-COMEDI_INITCLEANUP(driver_pcl726);
-
index 47a95d1a1ae8a998eb962764b56d67c2a9ea2cac..d2249f1432417b706ef6effb5b9456c7cb99f39a 100644 (file)
@@ -559,7 +559,7 @@ static void free_resources(comedi_device * dev)
        if (dev->irq)
                free_irq(dev->irq, dev);
        if (dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, this_board->io_range);
 #ifdef USE_DMA
        if (dev->private) {
                if (devpriv->dmabuf[0])
@@ -630,7 +630,6 @@ static int pcl812_attach(comedi_device * dev, comedi_devconfig * it)
        }
        request_region(iobase, this_board->io_range, "pcl812");
        dev->iobase = iobase;
-       dev->iosize = this_board->io_range;
 
        /* there should be a sanity check here */
 
index 500e98056efaad7796d46f599d12ff8ff490a3aa..d631848af9230c21bc31f29da226937489efc49e 100644 (file)
@@ -1330,7 +1330,7 @@ static void free_resources(comedi_device * dev)
        } 
 
        if (dev->irq) free_irq(dev->irq, dev);
-       if (dev->iobase) release_region(dev->iobase, dev->iosize);
+       if (dev->iobase) release_region(dev->iobase, this_board->io_range);
        //rt_printk("free_resource() end\n");
 }
 
@@ -1363,7 +1363,6 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it)
 
         request_region(iobase, io_range, "pcl818");
         dev->iobase=iobase;
-        dev->iosize=io_range;
     
         if (pcl818_check(iobase)) {
                rt_printk(", I can't detect board. FAIL!\n");
index 073a0b64e8b81e3129fe5f84d876bc21af527d16..c80dacb0ddd2c6fb0677753559607e01853c5945 100644 (file)
@@ -129,7 +129,6 @@ static int poc_attach(comedi_device *dev, comedi_devconfig *it)
        }
        request_region(iobase, iosize, "dac02");
        dev->iobase = iobase;
-       dev->iosize = iosize;
 
        dev->n_subdevices = 1;
        if(alloc_subdevices(dev) < 0)
@@ -156,7 +155,7 @@ static int poc_detach(comedi_device *dev)
 {
        /* only free stuff if it has been allocated by _attach */
        if(dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, this_board->iosize);
 
        printk("comedi%d: dac02: remove\n", dev->minor);
 
index 933ca6323b0bc53107e786bf92192f3e8c8e7748..c9d980c87819969bfa1d4f8eb277afc7cb235f42 100644 (file)
@@ -297,7 +297,6 @@ static int rti800_attach(comedi_device * dev, comedi_devconfig * it)
        }
        request_region(dev->iobase, RTI800_SIZE, "rti800");
        dev->iobase = iobase;
-       dev->iosize = RTI800_SIZE;
 
 #ifdef DEBUG
        printk("fingerprint=%x,%x,%x,%x,%x ",
@@ -427,7 +426,7 @@ static int rti800_detach(comedi_device * dev)
        printk("comedi%d: rti800: remove\n", dev->minor);
 
        if(dev->iobase)
-               release_region(dev->iobase, dev->iosize);
+               release_region(dev->iobase, RTI800_SIZE);
 
        if(dev->irq)
                free_irq(dev->irq,dev);