From: David Schleef Date: Tue, 15 Jan 2002 11:50:54 +0000 (+0000) Subject: Cleanups suggested by check_driver. Mostly leaky symbols, incorrect X-Git-Tag: r0_7_62~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fed1a4a0bb81b24cc1594d0ca7e06c29b9e27c7b;p=comedi.git Cleanups suggested by check_driver. Mostly leaky symbols, incorrect use of free_irq() and SA_SHIRQ, and pci_device_id tables. --- diff --git a/comedi/drivers/adl_pci9118.c b/comedi/drivers/adl_pci9118.c index b17e5be1..8489d67e 100644 --- a/comedi/drivers/adl_pci9118.c +++ b/comedi/drivers/adl_pci9118.c @@ -133,7 +133,7 @@ multiplexer. #define START_AI_EXT 0x01 /* start measure on external trigger */ #define STOP_AI_EXT 0x02 /* stop measure on external trigger */ -comedi_lrange range_pci9118dg_hr={ 8, { +static comedi_lrange range_pci9118dg_hr={ 8, { BIP_RANGE(5), BIP_RANGE(2.5), BIP_RANGE(1.25), @@ -145,7 +145,7 @@ comedi_lrange range_pci9118dg_hr={ 8, { } }; -comedi_lrange range_pci9118hg={ 8, { +static comedi_lrange range_pci9118hg={ 8, { BIP_RANGE(5), BIP_RANGE(0.5), BIP_RANGE(0.05), @@ -184,6 +184,12 @@ typedef struct { } boardtype; +static struct pci_device_id pci9118_pci_table[] __devinitdata = { + { PCI_VENDOR_ID_AMCC, 0x80d9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, pci9118_pci_table); + static boardtype boardtypes[] = { {"pci9118dg", PCI_VENDOR_ID_AMCC, 0x80d9, @@ -1376,7 +1382,7 @@ static int pci9118_detach(comedi_device *dev) if (devpriv->dmabuf_virt[1]) free_pages(devpriv->dmabuf_virt[1],devpriv->dmabuf_pages[1]); } - if(dev->irq) free_irq(dev->irq,dev); + if(dev->irq) comedi_free_irq(dev->irq,dev); if(dev->iobase) release_region(dev->iobase,this_board->iorange_9118); diff --git a/comedi/drivers/adv_pci1710.c b/comedi/drivers/adv_pci1710.c index 9e0fe859..efbd717b 100644 --- a/comedi/drivers/adv_pci1710.c +++ b/comedi/drivers/adv_pci1710.c @@ -65,6 +65,7 @@ Configuration options: #undef PCI171X_EXTDEBUG +#undef DPRINTK #ifdef PCI171X_EXTDEBUG #define DPRINTK(fmt, args...) rt_printk(fmt, ## args) #else @@ -207,6 +208,16 @@ typedef struct { unsigned int fifo_half_size; // size of FIFO/2 } boardtype; +static struct pci_device_id pci1710_pci_table[] = __devinitdata { + { ADVANTECH_VENDOR, 0x1710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { ADVANTECH_VENDOR, 0x1711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { ADVANTECH_VENDOR, 0x1713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { ADVANTECH_VENDOR, 0x1720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { ADVANTECH_VENDOR, 0x1731, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, pci1710_pci_table); + static boardtype boardtypes[] = { {"pci1710", ADVANTECH_VENDOR, 0x1710, @@ -1271,7 +1282,7 @@ static int pci1710_detach(comedi_device *dev) if (dev->private) if (devpriv->valid) pci1710_reset(dev); - if (dev->irq) free_irq(dev->irq,dev); + if (dev->irq) comedi_free_irq(dev->irq,dev); if (dev->iobase) release_region(dev->iobase,this_board->iorange); if (pci_list_builded) { diff --git a/comedi/drivers/amcc_s5933.c b/comedi/drivers/amcc_s5933.c index 90657107..55655444 100644 --- a/comedi/drivers/amcc_s5933.c +++ b/comedi/drivers/amcc_s5933.c @@ -208,3 +208,30 @@ struct pcilst_struct *select_and_alloc_pci_card(unsigned short vendor_id, unsign return card; } + +static int amcc_init(void) +{ + return 0; +} + +static void amcc_cleanup(void) +{ + +} + +module_init(amcc_init); +module_exit(amcc_cleanup); + +EXPORT_SYMBOL(pci_card_alloc); +EXPORT_SYMBOL(pci_card_data); +EXPORT_SYMBOL(pci_card_free); +EXPORT_SYMBOL(pci_card_list_cleanup); +EXPORT_SYMBOL(pci_card_list_display); +EXPORT_SYMBOL(pci_card_list_init); +EXPORT_SYMBOL(select_and_alloc_pci_card); +EXPORT_SYMBOL(find_free_pci_card_by_device); +EXPORT_SYMBOL(find_free_pci_card_by_position); +EXPORT_SYMBOL(amcc_devices); + + + diff --git a/comedi/drivers/amcc_s5933.h b/comedi/drivers/amcc_s5933.h index 0ab8daea..b602dfbf 100644 --- a/comedi/drivers/amcc_s5933.h +++ b/comedi/drivers/amcc_s5933.h @@ -179,7 +179,7 @@ struct pcilst_struct *find_free_pci_card_by_device(unsigned short vendor_id, uns int find_free_pci_card_by_position(unsigned short vendor_id, unsigned short device_id, unsigned short pci_bus, unsigned short pci_slot, struct pcilst_struct **card); struct pcilst_struct *select_and_alloc_pci_card(unsigned short vendor_id, unsigned short device_id, unsigned short pci_bus, unsigned short pci_slot); -int pci_card_alloc(struct pcilst_struct *amcc); +//int pci_card_alloc(struct pcilst_struct *amcc); int pci_card_free(struct pcilst_struct *amcc); void pci_card_list_display(void); int pci_card_data(struct pcilst_struct *amcc, diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index b0f85ab7..308ca4de 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -369,7 +369,7 @@ static int pci230_attach(comedi_device *dev,comedi_devconfig *it) dev->board_name = thisboard->name; /* Register the interrupt handler. */ - irq_hdl = comedi_request_irq(devpriv->pci_dev->irq, pci230_interrupt, 0, "PCI230", dev ); + irq_hdl = comedi_request_irq(devpriv->pci_dev->irq, pci230_interrupt, SA_SHIRQ, "amplc_pci230", dev); if(irq_hdl<0) { printk("comedi%d: amplc_pci230: unable to register irq, commands will not be available %d\n", dev->minor, devpriv->pci_dev->irq); } diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 7e0ac291..2f2f36c6 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -430,7 +430,7 @@ typedef struct */ static int cb_pcidas_attach(comedi_device *dev,comedi_devconfig *it); static int cb_pcidas_detach(comedi_device *dev); -comedi_driver driver_cb_pcidas={ +static comedi_driver driver_cb_pcidas={ driver_name: "cb_pcidas", module: THIS_MODULE, attach: cb_pcidas_attach, diff --git a/comedi/drivers/comedi_parport.c b/comedi/drivers/comedi_parport.c index b43732bd..4c2802b0 100644 --- a/comedi/drivers/comedi_parport.c +++ b/comedi/drivers/comedi_parport.c @@ -73,7 +73,7 @@ to change this, at least on a standard parallel port. Subdevice 3 pretends to be a digital input subdevice, but it always returns 0 when read. However, if you run a command with scan_begin_src=TRIG_EXT, it uses pin 13 as a external triggering -pin, which can be used to wake up tasks. +pin, which can be used to wake up tasks. (or is that pin 10. --ds) */ /* @@ -107,7 +107,7 @@ pin, which can be used to wake up tasks. static int parport_attach(comedi_device *dev,comedi_devconfig *it); static int parport_detach(comedi_device *dev); -comedi_driver driver_parport={ +static comedi_driver driver_parport={ driver_name: "comedi_parport", module: THIS_MODULE, attach: parport_attach, @@ -328,7 +328,7 @@ static int parport_attach(comedi_device *dev,comedi_devconfig *it) s=dev->subdevices+1; s->type=COMEDI_SUBD_DI; s->subdev_flags=SDF_READABLE; - s->n_chan=4; + s->n_chan=5; s->maxdata=1; s->range_table=&range_digital; s->insn_bits = parport_insn_b; diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index bf2dcb57..44889a28 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -136,7 +136,7 @@ static int timer_detach(comedi_device *dev); static int timer_inttrig(comedi_device *dev, comedi_subdevice *s, unsigned int trig_num); static int timer_start_cmd(comedi_device *dev, comedi_subdevice *s); -comedi_driver driver_timer={ +static comedi_driver driver_timer={ module: THIS_MODULE, driver_name: "comedi_rt_timer", attach: timer_attach, diff --git a/comedi/drivers/daqboard2000.c b/comedi/drivers/daqboard2000.c index 11b3fef3..1d78e063 100644 --- a/comedi/drivers/daqboard2000.c +++ b/comedi/drivers/daqboard2000.c @@ -312,7 +312,7 @@ typedef struct daqboard2000_hw { static int daqboard2000_attach(comedi_device *dev,comedi_devconfig *it); static int daqboard2000_detach(comedi_device *dev); -comedi_driver driver_daqboard2000 = { +static comedi_driver driver_daqboard2000 = { driver_name: "daqboard2000", module: THIS_MODULE, attach: daqboard2000_attach, diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index 19f9e4dc..b2501037 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -650,7 +650,7 @@ static struct das16_board_struct das16_boards[]={ static int das16_attach(comedi_device *dev,comedi_devconfig *it); static int das16_detach(comedi_device *dev); -comedi_driver driver_das16={ +static comedi_driver driver_das16={ driver_name: "das16", module: THIS_MODULE, attach: das16_attach, diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index 7be8e768..70791551 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -501,7 +501,7 @@ static comedi_lrange range_ao_2 = { }; */ -comedi_driver driver_das1800={ +static comedi_driver driver_das1800={ driver_name: "das1800", module: THIS_MODULE, attach: das1800_attach, diff --git a/comedi/drivers/das6402.c b/comedi/drivers/das6402.c index ee5e4a59..d709fd90 100644 --- a/comedi/drivers/das6402.c +++ b/comedi/drivers/das6402.c @@ -103,7 +103,7 @@ Devices: [Keithley Metrabyte] DAS6402 (das6402) static int das6402_attach(comedi_device *dev,comedi_devconfig *it); static int das6402_detach(comedi_device *dev); -comedi_driver driver_das6402={ +static comedi_driver driver_das6402={ driver_name: "das6402", module: THIS_MODULE, attach: das6402_attach, @@ -316,7 +316,7 @@ static int board_init(comedi_device *dev) static int das6402_detach(comedi_device *dev) { - if(dev->irq)free_irq(dev->irq,dev); + if(dev->irq)comedi_free_irq(dev->irq,dev); if(dev->iobase)release_region(dev->iobase,DAS6402_SIZE); return 0; diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index f572a4aa..2341e274 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -452,7 +452,7 @@ static int dt2811_detach(comedi_device * dev) printk("comedi%d: dt2811: remove\n", dev->minor); if (dev->irq) { - free_irq(dev->irq, dev); + comedi_free_irq(dev->irq, dev); } if(dev->iobase){ release_region(dev->iobase, DT2811_SIZE); diff --git a/comedi/drivers/dt2814.c b/comedi/drivers/dt2814.c index 341bfbbf..c29de31b 100644 --- a/comedi/drivers/dt2814.c +++ b/comedi/drivers/dt2814.c @@ -73,7 +73,7 @@ addition, the clock does not seem to be very accurate. static int dt2814_attach(comedi_device *dev,comedi_devconfig *it); static int dt2814_detach(comedi_device *dev); -comedi_driver driver_dt2814={ +static comedi_driver driver_dt2814={ driver_name: "dt2814", module: THIS_MODULE, attach: dt2814_attach, @@ -328,7 +328,7 @@ static int dt2814_detach(comedi_device *dev) printk("comedi%d: dt2814: remove\n",dev->minor); if(dev->irq){ - free_irq(dev->irq,dev); + comedi_free_irq(dev->irq,dev); } if(dev->iobase){ release_region(dev->iobase,DT2814_SIZE); diff --git a/comedi/drivers/dt2815.c b/comedi/drivers/dt2815.c index dd173270..ab242ccd 100644 --- a/comedi/drivers/dt2815.c +++ b/comedi/drivers/dt2815.c @@ -85,7 +85,7 @@ static comedi_lrange range_dt2815_ao_20_current = { 1, { static int dt2815_attach(comedi_device *dev,comedi_devconfig *it); static int dt2815_detach(comedi_device *dev); -comedi_driver driver_dt2815={ +static comedi_driver driver_dt2815={ driver_name: "dt2815", module: THIS_MODULE, attach: dt2815_attach, diff --git a/comedi/drivers/dt2817.c b/comedi/drivers/dt2817.c index bd3690ac..9f496413 100644 --- a/comedi/drivers/dt2817.c +++ b/comedi/drivers/dt2817.c @@ -62,7 +62,7 @@ Configuration options: static int dt2817_attach(comedi_device *dev,comedi_devconfig *it); static int dt2817_detach(comedi_device *dev); -comedi_driver driver_dt2817={ +static comedi_driver driver_dt2817={ driver_name: "dt2817", module: THIS_MODULE, attach: dt2817_attach, diff --git a/comedi/drivers/dt282x.c b/comedi/drivers/dt282x.c index fad42ba6..5a72f31e 100644 --- a/comedi/drivers/dt282x.c +++ b/comedi/drivers/dt282x.c @@ -370,7 +370,7 @@ typedef struct { static int dt282x_attach(comedi_device * dev, comedi_devconfig * it); static int dt282x_detach(comedi_device * dev); -comedi_driver driver_dt282x={ +static comedi_driver driver_dt282x={ driver_name: "dt282x", module: THIS_MODULE, attach: dt282x_attach, @@ -1328,7 +1328,7 @@ static int dt282x_attach(comedi_device * dev, comedi_devconfig * it) static void free_resources(comedi_device *dev) { if (dev->irq) { - free_irq(dev->irq, dev); + comedi_free_irq(dev->irq, dev); } if(dev->iobase) release_region(dev->iobase, DT2821_SIZE); diff --git a/comedi/drivers/dt3000.c b/comedi/drivers/dt3000.c index f757b378..fc1d020e 100644 --- a/comedi/drivers/dt3000.c +++ b/comedi/drivers/dt3000.c @@ -247,7 +247,7 @@ typedef struct{ static int dt3000_attach(comedi_device *dev,comedi_devconfig *it); static int dt3000_detach(comedi_device *dev); -comedi_driver driver_dt3000={ +static comedi_driver driver_dt3000={ driver_name: "dt3000", module: THIS_MODULE, attach: dt3000_attach, @@ -461,11 +461,7 @@ static int dt3000_attach(comedi_device *dev,comedi_devconfig *it) int ret=0; printk("dt3000:"); -#ifdef PCI_SUPPORT_VER1 - if(!pcibios_present()){ -#else if(!pci_present()){ -#endif printk(" no PCI bus\n"); return -EINVAL; } @@ -548,68 +544,6 @@ static int dt3000_detach(comedi_device *dev) } -#ifdef PCI_SUPPORT_VER1 -static int dt_pci_find_device(comedi_device *dev); -static int setup_pci(comedi_device *dev); - -static int dt_pci_probe(comedi_device *dev) -{ - int board; - int ret; - - ret=dt_pci_find_device(NULL,&board); - if(ret==0) - return 0; - - setup_pci(dev); - - return 1; -} - -static int dt_pci_find_device(comedi_device *dev) -{ - int i; - unsigned char pci_bus; - unsigned char pci_dev_fn; - - for(i=0;ipci_bus=pci_bus; - devpriv->pci_dev_fn=pci_dev_fn; - dev->board_ptr=dt3k_boards+i; - return 1; - } - } - return 0; -} - -static int setup_pci(comedi_device *dev) -{ - unsigned long offset; - u32 addr; - - pcibios_read_config_dword(devpriv->pci_bus,devpriv->pci_device_fn, - PCI_BASE_ADDRESS_0,&addr); - devpriv->phys_addr=addr; - offset=devpriv->phys_addr & ~PAGE_MASK; - devpriv->io_addr=ioremap(devpriv->phys_addr&PAGE_MASK,DT3000_SIZE+offset) - +offset; -#if DEBUG - printk("0x%08lx mapped to %p, ",devpriv->phys_addr,devpriv->io_addr); -#endif - - dev->iobase = (int)devpriv->io_addr; - - return 0; -} - -#else - static struct pci_dev *dt_pci_find_device(struct pci_dev *from,int *board); static int setup_pci(comedi_device *dev); @@ -709,5 +643,4 @@ static struct pci_dev *dt_pci_find_device(struct pci_dev *from,int *board) } #endif -#endif /* PCI_SUPPORT_VER1 */ diff --git a/comedi/drivers/fl512.c b/comedi/drivers/fl512.c index 3cacb811..9e02001a 100644 --- a/comedi/drivers/fl512.c +++ b/comedi/drivers/fl512.c @@ -49,7 +49,7 @@ static comedi_lrange range_fl512 = static int fl512_attach(comedi_device *dev,comedi_devconfig *it); static int fl512_detach(comedi_device *dev); -comedi_driver driver_fl512 = { +static comedi_driver driver_fl512 = { driver_name: "fl512", module: THIS_MODULE, attach: fl512_attach, diff --git a/comedi/drivers/ii_pci20kc.c b/comedi/drivers/ii_pci20kc.c index d9b3d22d..e98972aa 100644 --- a/comedi/drivers/ii_pci20kc.c +++ b/comedi/drivers/ii_pci20kc.c @@ -168,7 +168,7 @@ typedef struct { static int pci20xxx_attach(comedi_device * dev, comedi_devconfig * it); static int pci20xxx_detach(comedi_device * dev); -comedi_driver driver_pci20xxx = { +static comedi_driver driver_pci20xxx = { driver_name: "ii_pci20kc", module: THIS_MODULE, attach: pci20xxx_attach, diff --git a/comedi/drivers/mpc8260cpm.c b/comedi/drivers/mpc8260cpm.c index 68dd457f..343d0080 100644 --- a/comedi/drivers/mpc8260cpm.c +++ b/comedi/drivers/mpc8260cpm.c @@ -55,7 +55,7 @@ typedef struct{ static int mpc8260cpm_attach(comedi_device *dev,comedi_devconfig *it); static int mpc8260cpm_detach(comedi_device *dev); -comedi_driver driver_mpc8260cpm={ +static comedi_driver driver_mpc8260cpm={ driver_name: "dummy", module: THIS_MODULE, attach: mpc8260cpm_attach, diff --git a/comedi/drivers/multiq3.c b/comedi/drivers/multiq3.c index c1316436..906fe5ce 100644 --- a/comedi/drivers/multiq3.c +++ b/comedi/drivers/multiq3.c @@ -95,7 +95,7 @@ Devices: [Quanser Consulting] MultiQ-3 (multiq3) static int multiq3_attach(comedi_device *dev,comedi_devconfig *it); static int multiq3_detach(comedi_device *dev); -comedi_driver driver_multiq3={ +static comedi_driver driver_multiq3={ driver_name: "multiq3", module: THIS_MODULE, attach: multiq3_attach, diff --git a/comedi/drivers/ni_670x.c b/comedi/drivers/ni_670x.c index 124f5de8..780be78c 100644 --- a/comedi/drivers/ni_670x.c +++ b/comedi/drivers/ni_670x.c @@ -72,7 +72,7 @@ typedef struct ni_670x_board_struct unsigned short ao_chans; unsigned short ao_bits; }ni_670x_board; -ni_670x_board ni_670x_boards[] = +static ni_670x_board ni_670x_boards[] = { { dev_id : 0x2c90, diff --git a/comedi/drivers/ni_at_a2150.c b/comedi/drivers/ni_at_a2150.c index d3f9b0ac..b6233f37 100644 --- a/comedi/drivers/ni_at_a2150.c +++ b/comedi/drivers/ni_at_a2150.c @@ -178,7 +178,7 @@ static int a2150_attach(comedi_device *dev,comedi_devconfig *it); static int a2150_detach(comedi_device *dev); static int a2150_cancel(comedi_device *dev, comedi_subdevice *s); -comedi_driver driver_a2150={ +static comedi_driver driver_a2150={ driver_name: "ni_at_a2150", module: THIS_MODULE, attach: a2150_attach, diff --git a/comedi/drivers/ni_atmio.c b/comedi/drivers/ni_atmio.c index fdc9ad99..1dccaf4c 100644 --- a/comedi/drivers/ni_atmio.c +++ b/comedi/drivers/ni_atmio.c @@ -275,7 +275,7 @@ typedef struct{ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it); static int ni_atmio_detach(comedi_device *dev); -comedi_driver driver_atmio={ +static comedi_driver driver_atmio={ driver_name: "ni_atmio", module: THIS_MODULE, attach: ni_atmio_attach, diff --git a/comedi/drivers/ni_atmio16d.c b/comedi/drivers/ni_atmio16d.c index fcf490b9..f4d8a1e6 100644 --- a/comedi/drivers/ni_atmio16d.c +++ b/comedi/drivers/ni_atmio16d.c @@ -144,7 +144,7 @@ static void reset_counters(comedi_device *dev); static void reset_atmio16d(comedi_device *dev); /* main driver struct */ -comedi_driver driver_atmio16d={ +static comedi_driver driver_atmio16d={ driver_name: "atmio16", module: THIS_MODULE, attach: atmio16d_attach, @@ -867,7 +867,7 @@ static int atmio16d_detach(comedi_device * dev) subdev_8255_cleanup(dev,dev->subdevices + 3); if(dev->irq) - free_irq(dev->irq,dev); + comedi_free_irq(dev->irq,dev); reset_atmio16d(dev); diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index be65409c..26702862 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1728,7 +1728,7 @@ static int ni_ao_cmd(comedi_device *dev,comedi_subdevice *s) } /* not all boards can deglitch, but this shouldn't hurt */ - if(cmd->flags & TRIG_DEGLITCH) /* XXX ? */ + if(cmd->chanlist[i] & CR_DITHER) conf |= AO_Deglitch; /* analog reference */ diff --git a/comedi/drivers/ni_mio_cs.c b/comedi/drivers/ni_mio_cs.c index d674cc2a..f73cf7d2 100644 --- a/comedi/drivers/ni_mio_cs.c +++ b/comedi/drivers/ni_mio_cs.c @@ -168,7 +168,7 @@ typedef struct{ static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it); static int mio_cs_detach(comedi_device *dev); -comedi_driver driver_ni_mio_cs={ +static comedi_driver driver_ni_mio_cs={ driver_name: "ni_mio_cs", module: THIS_MODULE, attach: mio_cs_attach, diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index 09d3f3eb..b3968006 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -173,7 +173,7 @@ AT-MIO96. static int nidio_attach(comedi_device *dev,comedi_devconfig *it); static int nidio_detach(comedi_device *dev); -comedi_driver driver_pcidio={ +static comedi_driver driver_pcidio={ driver_name: "ni_pcidio", module: THIS_MODULE, attach: nidio_attach, diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index efc71004..cab96086 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -525,7 +525,7 @@ static ni_board ni_boards[]={ static int pcimio_attach(comedi_device *dev,comedi_devconfig *it); static int pcimio_detach(comedi_device *dev); -comedi_driver driver_pcimio={ +static comedi_driver driver_pcimio={ driver_name: "ni_pcimio", module: THIS_MODULE, attach: pcimio_attach, diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index fb110bfc..f0dee570 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -490,7 +490,7 @@ static int pcl711_detach(comedi_device * dev) printk("comedi%d: pcl711: remove\n", dev->minor); if (dev->irq) - free_irq(dev->irq, dev); + comedi_free_irq(dev->irq, dev); if (dev->iobase) release_region(dev->iobase, PCL711_SIZE); diff --git a/comedi/drivers/pcl724.c b/comedi/drivers/pcl724.c index d92fb09c..2f201099 100644 --- a/comedi/drivers/pcl724.c +++ b/comedi/drivers/pcl724.c @@ -90,7 +90,7 @@ static boardtype boardtypes[] = #define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype)) #define this_board ((boardtype *)dev->board_ptr) -comedi_driver driver_pcl724={ +static comedi_driver driver_pcl724={ driver_name: "pcl724", module: THIS_MODULE, attach: pcl724_attach, @@ -207,7 +207,7 @@ static int pcl724_detach(comedi_device *dev) #ifdef PCL724_IRQ if(dev->irq){ - free_irq(dev->irq,dev); + comedi_free_irq(dev->irq,dev); } #endif diff --git a/comedi/drivers/pcl725.c b/comedi/drivers/pcl725.c index 7d438ddf..f9c7e5ea 100644 --- a/comedi/drivers/pcl725.c +++ b/comedi/drivers/pcl725.c @@ -33,7 +33,7 @@ Devices: [Advantech] PCL-725 (pcl725) static int pcl725_attach(comedi_device *dev,comedi_devconfig *it); static int pcl725_detach(comedi_device *dev); -comedi_driver driver_pcl725={ +static comedi_driver driver_pcl725={ driver_name: "pcl725", module: THIS_MODULE, attach: pcl725_attach, diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index 9eeb9de9..924a14ca 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -368,7 +368,7 @@ static int pcl726_detach(comedi_device *dev) #ifdef ACL6126_IRQ if(dev->irq){ - free_irq(dev->irq,dev); + comedi_free_irq(dev->irq,dev); } #endif diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index e511686a..233e342c 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -1136,7 +1136,7 @@ static void free_resources(comedi_device * dev) free_dma(devpriv->dma); } if (dev->irq) - free_irq(dev->irq, dev); + comedi_free_irq(dev->irq, dev); if (dev->iobase) release_region(dev->iobase, this_board->io_range); } diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 85080de1..e6e8017c 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -1392,7 +1392,7 @@ static void free_resources(comedi_device * dev) if (devpriv->dma) free_dma(devpriv->dma); if (devpriv->dmabuf[0]) free_pages(devpriv->dmabuf[0], devpriv->dmapages[0]); if (devpriv->dmabuf[1]) free_pages(devpriv->dmabuf[1], devpriv->dmapages[1]); - if (devpriv->rtc_irq) free_irq(devpriv->rtc_irq, dev); + if (devpriv->rtc_irq) comedi_free_irq(devpriv->rtc_irq, dev); if ((devpriv->dma_rtc)&&(RTC_lock==1)) { if (devpriv->rtc_iobase) release_region(devpriv->rtc_iobase, devpriv->rtc_iosize); @@ -1483,7 +1483,7 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) devpriv->rtc_iobase=RTC_PORT(0); devpriv->rtc_iosize=RTC_IO_EXTENT; RTC_lock++; - if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, SA_SHIRQ, "pcl818 DMA (RTC)", dev)) { + if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, 0, "pcl818 DMA (RTC)", dev)) { devpriv->dma_rtc=1; devpriv->rtc_irq=RTC_IRQ; rt_printk(", dma_irq=%d", devpriv->rtc_irq); diff --git a/comedi/drivers/pcm3730.c b/comedi/drivers/pcm3730.c index 2e509e12..f7fb1d5d 100644 --- a/comedi/drivers/pcm3730.c +++ b/comedi/drivers/pcm3730.c @@ -40,7 +40,7 @@ Configuration options: static int pcm3730_attach(comedi_device *dev,comedi_devconfig *it); static int pcm3730_detach(comedi_device *dev); -comedi_driver driver_pcm3730={ +static comedi_driver driver_pcm3730={ driver_name: "pcm3730", module: THIS_MODULE, attach: pcm3730_attach, diff --git a/comedi/drivers/poc.c b/comedi/drivers/poc.c index 73b07610..0c0daa20 100644 --- a/comedi/drivers/poc.c +++ b/comedi/drivers/poc.c @@ -87,7 +87,7 @@ static struct boarddef_struct boards[]={ #define n_boards (sizeof(boards)/sizeof(boards[0])) #define this_board ((struct boarddef_struct *)dev->board_ptr) -comedi_driver driver_poc= +static comedi_driver driver_poc= { driver_name: "poc", module: THIS_MODULE, diff --git a/comedi/drivers/quatech_daqp_cs.c b/comedi/drivers/quatech_daqp_cs.c index 619c5731..cb460110 100644 --- a/comedi/drivers/quatech_daqp_cs.c +++ b/comedi/drivers/quatech_daqp_cs.c @@ -238,7 +238,7 @@ static comedi_lrange range_daqp_ai = { 4, { static int daqp_attach(comedi_device *dev,comedi_devconfig *it); static int daqp_detach(comedi_device *dev); -comedi_driver driver_daqp={ +static comedi_driver driver_daqp={ driver_name: "daqp", module: THIS_MODULE, attach: daqp_attach, diff --git a/comedi/drivers/rtd520.c b/comedi/drivers/rtd520.c index 43f1ffbc..f1b00555 100644 --- a/comedi/drivers/rtd520.c +++ b/comedi/drivers/rtd520.c @@ -709,7 +709,7 @@ static int rtd_attach ( dev->irq = devpriv->pci_dev->irq; if(dev->irq>0){ if((ret=comedi_request_irq (dev->irq, rtd_interrupt, - 0, "rtd520", dev))<0) + SA_SHIRQ, "rtd520", dev))<0) return ret; printk("( irq = %d )\n", dev->irq); } else { diff --git a/comedi/drivers/rti800.c b/comedi/drivers/rti800.c index e3af55bf..73d70dc3 100644 --- a/comedi/drivers/rti800.c +++ b/comedi/drivers/rti800.c @@ -443,7 +443,7 @@ static int rti800_detach(comedi_device * dev) release_region(dev->iobase, RTI800_SIZE); if(dev->irq) - free_irq(dev->irq,dev); + comedi_free_irq(dev->irq,dev); return 0; } diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index 7b90e0e3..b0f54abc 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -82,6 +82,8 @@ static skel_board skel_boards[] = { /* This is used by modprobe to translate PCI IDs to drivers. Should * only be used for PCI and ISA-PnP devices */ +/* Please add your PCI vendor ID to comedidev.h, and it will be forwarded + * upstream. */ #define PCI_VENDOR_ID_SKEL 0xdafe static struct pci_device_id skel_pci_table[] __devinitdata = { { PCI_VENDOR_ID_SKEL, 0x0100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, diff --git a/comedi/drivers/ssv_dnp.c b/comedi/drivers/ssv_dnp.c index 835cd3d8..b8395330 100644 --- a/comedi/drivers/ssv_dnp.c +++ b/comedi/drivers/ssv_dnp.c @@ -72,7 +72,7 @@ typedef struct dnp_board_struct{ int have_dio; } dnp_board; -dnp_board dnp_boards[] = { /* we only support one DNP 'board' */ +static dnp_board dnp_boards[] = { /* we only support one DNP 'board' */ { /* variant at the moment */ name: "dnp-1486", ai_chans: 16, @@ -106,7 +106,7 @@ typedef struct{ static int dnp_attach(comedi_device *dev,comedi_devconfig *it); static int dnp_detach(comedi_device *dev); -comedi_driver driver_dnp = { +static comedi_driver driver_dnp = { driver_name: "ssv_dnp", module: THIS_MODULE, attach: dnp_attach, @@ -200,10 +200,6 @@ static int dnp_attach(comedi_device *dev,comedi_devconfig *it) static int dnp_detach(comedi_device *dev) { - /* deallocate I/O ports: */ -# warning region should be released here! - /*release_region(0x22,2);*/ - /* configure all ports as input (default) */ outb(PAMR,CSCIR); outb(0x00,CSCDR); outb(PBMR,CSCIR); outb(0x00,CSCDR);