From b3393fb02107bb0b19b382e27a0e355f5c0b4f4a Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 22 Mar 2001 00:02:37 +0000 Subject: [PATCH] removed dev->iosize --- comedi/drivers/adl_pci9118.c | 7 ++++--- comedi/drivers/comedi_parport.c | 7 +++---- comedi/drivers/das08.c | 1 - comedi/drivers/das1800.c | 1 - comedi/drivers/das800.c | 1 - comedi/drivers/dt2811.c | 5 +++-- comedi/drivers/dt2814.c | 3 +-- comedi/drivers/dt2817.c | 4 ++-- comedi/drivers/dt282x.c | 3 +-- comedi/drivers/multiq3.c | 3 +-- comedi/drivers/ni_atmio.c | 1 - comedi/drivers/ni_atmio16d.c | 3 +-- comedi/drivers/pcl711.c | 3 +-- comedi/drivers/pcl724.c | 6 ++---- comedi/drivers/pcl725.c | 3 +-- comedi/drivers/pcl726.c | 6 ++---- comedi/drivers/pcl812.c | 3 +-- comedi/drivers/pcl818.c | 3 +-- comedi/drivers/poc.c | 3 +-- comedi/drivers/rti800.c | 3 +-- 20 files changed, 26 insertions(+), 43 deletions(-) diff --git a/comedi/drivers/adl_pci9118.c b/comedi/drivers/adl_pci9118.c index 31bf1ef8..6ff3a128 100644 --- a/comedi/drivers/adl_pci9118.c +++ b/comedi/drivers/adl_pci9118.c @@ -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; } diff --git a/comedi/drivers/comedi_parport.c b/comedi/drivers/comedi_parport.c index e5c43053..fcf2807f 100644 --- a/comedi/drivers/comedi_parport.c +++ b/comedi/drivers/comedi_parport.c @@ -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); - diff --git a/comedi/drivers/das08.c b/comedi/drivers/das08.c index 47cce6aa..ee49bd78 100644 --- a/comedi/drivers/das08.c +++ b/comedi/drivers/das08.c @@ -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) diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index 81cf3bdd..747e817d 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -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) diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index 652a9a4f..6142c845 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -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) diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index 0586f76c..d77481f1 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -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; } diff --git a/comedi/drivers/dt2814.c b/comedi/drivers/dt2814.c index 651c6fc3..98ca568e 100644 --- a/comedi/drivers/dt2814.c +++ b/comedi/drivers/dt2814.c @@ -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; diff --git a/comedi/drivers/dt2817.c b/comedi/drivers/dt2817.c index bdfa7f17..a7b7d7c2 100644 --- a/comedi/drivers/dt2817.c +++ b/comedi/drivers/dt2817.c @@ -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; } diff --git a/comedi/drivers/dt282x.c b/comedi/drivers/dt282x.c index 7b8845d9..a84ed163 100644 --- a/comedi/drivers/dt282x.c +++ b/comedi/drivers/dt282x.c @@ -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); diff --git a/comedi/drivers/multiq3.c b/comedi/drivers/multiq3.c index fa9c1d19..84787038 100644 --- a/comedi/drivers/multiq3.c +++ b/comedi/drivers/multiq3.c @@ -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; diff --git a/comedi/drivers/ni_atmio.c b/comedi/drivers/ni_atmio.c index 14177807..59e4b9ce 100644 --- a/comedi/drivers/ni_atmio.c +++ b/comedi/drivers/ni_atmio.c @@ -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 */ diff --git a/comedi/drivers/ni_atmio16d.c b/comedi/drivers/ni_atmio16d.c index b8ac09d7..9f1b047e 100644 --- a/comedi/drivers/ni_atmio16d.c +++ b/comedi/drivers/ni_atmio16d.c @@ -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; } diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index b4d28d5d..718cf307 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -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 */ diff --git a/comedi/drivers/pcl724.c b/comedi/drivers/pcl724.c index 41d340a6..08f17e85 100644 --- a/comedi/drivers/pcl724.c +++ b/comedi/drivers/pcl724.c @@ -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); - diff --git a/comedi/drivers/pcl725.c b/comedi/drivers/pcl725.c index 874f0500..96599b43 100644 --- a/comedi/drivers/pcl725.c +++ b/comedi/drivers/pcl725.c @@ -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; } diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index 354f2a2e..e2ff37c3 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -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); - diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index 47a95d1a..d2249f14 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -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 */ diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 500e9805..d631848a 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -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"); diff --git a/comedi/drivers/poc.c b/comedi/drivers/poc.c index 073a0b64..c80dacb0 100644 --- a/comedi/drivers/poc.c +++ b/comedi/drivers/poc.c @@ -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); diff --git a/comedi/drivers/rti800.c b/comedi/drivers/rti800.c index 933ca632..c9d980c8 100644 --- a/comedi/drivers/rti800.c +++ b/comedi/drivers/rti800.c @@ -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); -- 2.26.2