From 7114a28011f9d5f3d981731ad341177c21f9d948 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Sun, 6 Jun 2010 22:23:30 +0200 Subject: [PATCH] Staging: comedi: Remove COMEDI_INITCLEANUP macro Move the init/exit routines to the respective C source files instead of calling COMEDI_INITCLEANUP Signed-off-by: Arun Thomas Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedidev.h | 11 ----------- drivers/staging/comedi/drivers/8255.c | 13 ++++++++++++- drivers/staging/comedi/drivers/acl7225b.c | 13 ++++++++++++- drivers/staging/comedi/drivers/adq12b.c | 13 ++++++++++++- drivers/staging/comedi/drivers/aio_aio12_8.c | 13 ++++++++++++- drivers/staging/comedi/drivers/aio_iiro_16.c | 13 ++++++++++++- drivers/staging/comedi/drivers/amplc_dio200.c | 13 ++++++++++++- drivers/staging/comedi/drivers/amplc_pc236.c | 13 ++++++++++++- drivers/staging/comedi/drivers/amplc_pc263.c | 13 ++++++++++++- drivers/staging/comedi/drivers/c6xdigio.c | 13 ++++++++++++- drivers/staging/comedi/drivers/cb_das16_cs.c | 13 ++++++++++++- drivers/staging/comedi/drivers/comedi_parport.c | 13 ++++++++++++- drivers/staging/comedi/drivers/comedi_test.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das08.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das16.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das16m1.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das1800.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das6402.c | 13 ++++++++++++- drivers/staging/comedi/drivers/das800.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dmm32at.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt2801.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt2811.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt2814.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt2815.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt2817.c | 13 ++++++++++++- drivers/staging/comedi/drivers/dt282x.c | 13 ++++++++++++- drivers/staging/comedi/drivers/fl512.c | 13 ++++++++++++- drivers/staging/comedi/drivers/icp_multi.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ii_pci20kc.c | 13 ++++++++++++- drivers/staging/comedi/drivers/mpc624.c | 13 ++++++++++++- drivers/staging/comedi/drivers/mpc8260cpm.c | 13 ++++++++++++- drivers/staging/comedi/drivers/multiq3.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ni_at_a2150.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ni_at_ao.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ni_atmio.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ni_atmio16d.c | 13 ++++++++++++- drivers/staging/comedi/drivers/ni_labpc.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl711.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl724.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl725.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl726.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl730.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl812.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl816.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcl818.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcm3724.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcm3730.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcmad.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcmda12.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcmmio.c | 13 ++++++++++++- drivers/staging/comedi/drivers/pcmuio.c | 13 ++++++++++++- drivers/staging/comedi/drivers/poc.c | 13 ++++++++++++- drivers/staging/comedi/drivers/rti800.c | 13 ++++++++++++- drivers/staging/comedi/drivers/rti802.c | 13 ++++++++++++- drivers/staging/comedi/drivers/s526.c | 13 ++++++++++++- drivers/staging/comedi/drivers/serial2002.c | 13 ++++++++++++- drivers/staging/comedi/drivers/skel.c | 17 ++++++++++++----- drivers/staging/comedi/drivers/ssv_dnp.c | 13 ++++++++++++- drivers/staging/comedi/drivers/unioxx5.c | 13 ++++++++++++- 59 files changed, 696 insertions(+), 73 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 8daff9464fb..8e0106520c2 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -53,17 +53,6 @@ COMEDI_MINORVERSION, COMEDI_MICROVERSION) #define COMEDI_RELEASE VERSION -#define COMEDI_INITCLEANUP_NOMODULE(x) \ - static int __init x ## _init_module(void) \ - {return comedi_driver_register(&(x)); } \ - static void __exit x ## _cleanup_module(void) \ - {comedi_driver_unregister(&(x)); } \ - module_init(x ## _init_module); \ - module_exit(x ## _cleanup_module); - -#define COMEDI_INITCLEANUP(x) \ - COMEDI_INITCLEANUP_NOMODULE(x) - #define COMEDI_PCI_INITCLEANUP_NOMODULE(comedi_driver, pci_id_table) \ static int __devinit comedi_driver ## _pci_probe(struct pci_dev *dev, \ const struct pci_device_id *ent) \ diff --git a/drivers/staging/comedi/drivers/8255.c b/drivers/staging/comedi/drivers/8255.c index 0f83090488d..95049a8d3b3 100644 --- a/drivers/staging/comedi/drivers/8255.c +++ b/drivers/staging/comedi/drivers/8255.c @@ -117,7 +117,18 @@ static struct comedi_driver driver_8255 = { .detach = dev_8255_detach, }; -COMEDI_INITCLEANUP(driver_8255); +static int __init driver_8255_init_module(void) +{ + return comedi_driver_register(&driver_8255); +} + +static void __exit driver_8255_cleanup_module(void) +{ + comedi_driver_unregister(&driver_8255); +} + +module_init(driver_8255_init_module); +module_exit(driver_8255_cleanup_module); static void do_config(struct comedi_device *dev, struct comedi_subdevice *s); diff --git a/drivers/staging/comedi/drivers/acl7225b.c b/drivers/staging/comedi/drivers/acl7225b.c index 1d0a8ea7795..9def2250bb8 100644 --- a/drivers/staging/comedi/drivers/acl7225b.c +++ b/drivers/staging/comedi/drivers/acl7225b.c @@ -49,7 +49,18 @@ static struct comedi_driver driver_acl7225b = { .offset = sizeof(struct boardtype), }; -COMEDI_INITCLEANUP(driver_acl7225b); +static int __init driver_acl7225b_init_module(void) +{ + return comedi_driver_register(&driver_acl7225b); +} + +static void __exit driver_acl7225b_cleanup_module(void) +{ + comedi_driver_unregister(&driver_acl7225b); +} + +module_init(driver_acl7225b_init_module); +module_exit(driver_acl7225b_cleanup_module); static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c index f318a01dd57..4b470000b69 100644 --- a/drivers/staging/comedi/drivers/adq12b.c +++ b/drivers/staging/comedi/drivers/adq12b.c @@ -402,7 +402,18 @@ static int adq12b_do_insn_bits(struct comedi_device *dev, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_adq12b); +static int __init driver_adq12b_init_module(void) +{ + return comedi_driver_register(&driver_adq12b); +} + +static void __exit driver_adq12b_cleanup_module(void) +{ + comedi_driver_unregister(&driver_adq12b); +} + +module_init(driver_adq12b_init_module); +module_exit(driver_adq12b_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/aio_aio12_8.c b/drivers/staging/comedi/drivers/aio_aio12_8.c index dc00c4b4a15..1728cc013d1 100644 --- a/drivers/staging/comedi/drivers/aio_aio12_8.c +++ b/drivers/staging/comedi/drivers/aio_aio12_8.c @@ -227,7 +227,18 @@ static struct comedi_driver driver_aio_aio12_8 = { .offset = sizeof(struct aio12_8_boardtype), }; -COMEDI_INITCLEANUP(driver_aio_aio12_8); +static int __init driver_aio_aio12_8_init_module(void) +{ + return comedi_driver_register(&driver_aio_aio12_8); +} + +static void __exit driver_aio_aio12_8_cleanup_module(void) +{ + comedi_driver_unregister(&driver_aio_aio12_8); +} + +module_init(driver_aio_aio12_8_init_module); +module_exit(driver_aio_aio12_8_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/aio_iiro_16.c b/drivers/staging/comedi/drivers/aio_iiro_16.c index ad5e75babdd..487599531fe 100644 --- a/drivers/staging/comedi/drivers/aio_iiro_16.c +++ b/drivers/staging/comedi/drivers/aio_iiro_16.c @@ -184,7 +184,18 @@ static int aio_iiro_16_dio_insn_bits_read(struct comedi_device *dev, return 2; } -COMEDI_INITCLEANUP(driver_aio_iiro_16); +static int __init driver_aio_iiro_16_init_module(void) +{ + return comedi_driver_register(&driver_aio_iiro_16); +} + +static void __exit driver_aio_iiro_16_cleanup_module(void) +{ + comedi_driver_unregister(&driver_aio_iiro_16); +} + +module_init(driver_aio_iiro_16_init_module); +module_exit(driver_aio_iiro_16_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c index 9a60c214373..674cf1df7e2 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.c +++ b/drivers/staging/comedi/drivers/amplc_dio200.c @@ -496,7 +496,18 @@ static struct comedi_driver driver_amplc_dio200 = { #ifdef CONFIG_COMEDI_PCI COMEDI_PCI_INITCLEANUP(driver_amplc_dio200, dio200_pci_table); #else -COMEDI_INITCLEANUP(driver_amplc_dio200); +static int __init driver_amplc_dio200_init_module(void) +{ + return comedi_driver_register(&driver_amplc_dio200); +} + +static void __exit driver_amplc_dio200_cleanup_module(void) +{ + comedi_driver_unregister(&driver_amplc_dio200); +} + +module_init(driver_amplc_dio200_init_module); +module_exit(driver_amplc_dio200_cleanup_module); #endif /* diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c b/drivers/staging/comedi/drivers/amplc_pc236.c index e94fb3e3d0e..5ffee055c9a 100644 --- a/drivers/staging/comedi/drivers/amplc_pc236.c +++ b/drivers/staging/comedi/drivers/amplc_pc236.c @@ -184,7 +184,18 @@ static struct comedi_driver driver_amplc_pc236 = { #ifdef CONFIG_COMEDI_PCI COMEDI_PCI_INITCLEANUP(driver_amplc_pc236, pc236_pci_table); #else -COMEDI_INITCLEANUP(driver_amplc_pc236); +static int __init driver_amplc_pc236_init_module(void) +{ + return comedi_driver_register(&driver_amplc_pc236); +} + +static void __exit driver_amplc_pc236_cleanup_module(void) +{ + comedi_driver_unregister(&driver_amplc_pc236); +} + +module_init(driver_amplc_pc236_init_module); +module_exit(driver_amplc_pc236_cleanup_module); #endif static int pc236_request_region(unsigned minor, unsigned long from, diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c index 14855e37476..83af437eb43 100644 --- a/drivers/staging/comedi/drivers/amplc_pc263.c +++ b/drivers/staging/comedi/drivers/amplc_pc263.c @@ -434,7 +434,18 @@ static int pc263_dio_insn_config(struct comedi_device *dev, #ifdef CONFIG_COMEDI_PCI COMEDI_PCI_INITCLEANUP(driver_amplc_pc263, pc263_pci_table); #else -COMEDI_INITCLEANUP(driver_amplc_pc263); +static int __init driver_amplc_pc263_init_module(void) +{ + return comedi_driver_register(&driver_amplc_pc263); +} + +static void __exit driver_amplc_pc263_cleanup_module(void) +{ + comedi_driver_unregister(&driver_amplc_pc263); +} + +module_init(driver_amplc_pc263_init_module); +module_exit(driver_amplc_pc263_cleanup_module); #endif MODULE_AUTHOR("Comedi http://www.comedi.org"); diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c index d830176bbd0..e0ac825ea58 100644 --- a/drivers/staging/comedi/drivers/c6xdigio.c +++ b/drivers/staging/comedi/drivers/c6xdigio.c @@ -517,7 +517,18 @@ static int c6xdigio_detach(struct comedi_device *dev) return 0; } -COMEDI_INITCLEANUP(driver_c6xdigio); +static int __init driver_c6xdigio_init_module(void) +{ + return comedi_driver_register(&driver_c6xdigio); +} + +static void __exit driver_c6xdigio_cleanup_module(void) +{ + comedi_driver_unregister(&driver_c6xdigio); +} + +module_init(driver_c6xdigio_init_module); +module_exit(driver_c6xdigio_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c index d8d4ed6de35..6d893c65adc 100644 --- a/drivers/staging/comedi/drivers/cb_das16_cs.c +++ b/drivers/staging/comedi/drivers/cb_das16_cs.c @@ -880,5 +880,16 @@ void __exit cleanup_module(void) } #else -COMEDI_INITCLEANUP(driver_das16cs); +static int __init driver_das16cs_init_module(void) +{ + return comedi_driver_register(&driver_das16cs); +} + +static void __exit driver_das16cs_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das16cs); +} + +module_init(driver_das16cs_init_module); +module_exit(driver_das16cs_cleanup_module); #endif /* CONFIG_PCMCIA */ diff --git a/drivers/staging/comedi/drivers/comedi_parport.c b/drivers/staging/comedi/drivers/comedi_parport.c index 9cf76fdd7cb..21d834dd92b 100644 --- a/drivers/staging/comedi/drivers/comedi_parport.c +++ b/drivers/staging/comedi/drivers/comedi_parport.c @@ -101,7 +101,18 @@ static struct comedi_driver driver_parport = { .detach = parport_detach, }; -COMEDI_INITCLEANUP(driver_parport); +static int __init driver_parport_init_module(void) +{ + return comedi_driver_register(&driver_parport); +} + +static void __exit driver_parport_cleanup_module(void) +{ + comedi_driver_unregister(&driver_parport); +} + +module_init(driver_parport_init_module); +module_exit(driver_parport_cleanup_module); struct parport_private { unsigned int a_data; diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index a21fe2e47a4..b220b305541 100644 --- a/drivers/staging/comedi/drivers/comedi_test.c +++ b/drivers/staging/comedi/drivers/comedi_test.c @@ -107,7 +107,18 @@ static struct comedi_driver driver_waveform = { .num_names = ARRAY_SIZE(waveform_boards), }; -COMEDI_INITCLEANUP(driver_waveform); +static int __init driver_waveform_init_module(void) +{ + return comedi_driver_register(&driver_waveform); +} + +static void __exit driver_waveform_cleanup_module(void) +{ + comedi_driver_unregister(&driver_waveform); +} + +module_init(driver_waveform_init_module); +module_exit(driver_waveform_cleanup_module); static int waveform_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index 3a52a0c0f92..c3f1fedc6eb 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -1084,7 +1084,18 @@ EXPORT_SYMBOL_GPL(das08_common_detach); #ifdef CONFIG_COMEDI_PCI COMEDI_PCI_INITCLEANUP(driver_das08, das08_pci_table); #else -COMEDI_INITCLEANUP(driver_das08); +static int __init driver_das08_init_module(void) +{ + return comedi_driver_register(&driver_das08); +} + +static void __exit driver_das08_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das08); +} + +module_init(driver_das08_init_module); +module_exit(driver_das08_cleanup_module); #endif #ifdef CONFIG_COMEDI_PCMCIA diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 407d011a760..0af1b465908 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -1717,7 +1717,18 @@ static int das16_detach(struct comedi_device *dev) return 0; } -COMEDI_INITCLEANUP(driver_das16); +static int __init driver_das16_init_module(void) +{ + return comedi_driver_register(&driver_das16); +} + +static void __exit driver_das16_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das16); +} + +module_init(driver_das16_init_module); +module_exit(driver_das16_cleanup_module); /* utility function that suggests a dma transfer size in bytes */ static unsigned int das16_suggest_transfer_size(struct comedi_device *dev, diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c index 387a8cbe855..a5ce3b2abe4 100644 --- a/drivers/staging/comedi/drivers/das16m1.c +++ b/drivers/staging/comedi/drivers/das16m1.c @@ -198,7 +198,18 @@ struct das16m1_private_struct { #define devpriv ((struct das16m1_private_struct *)(dev->private)) #define thisboard ((const struct das16m1_board *)(dev->board_ptr)) -COMEDI_INITCLEANUP(driver_das16m1); +static int __init driver_das16m1_init_module(void) +{ + return comedi_driver_register(&driver_das16m1); +} + +static void __exit driver_das16m1_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das16m1); +} + +module_init(driver_das16m1_init_module); +module_exit(driver_das16m1_cleanup_module); static inline short munge_sample(short data) { diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c index a68a1e47db8..6ea93f9c0b4 100644 --- a/drivers/staging/comedi/drivers/das1800.c +++ b/drivers/staging/comedi/drivers/das1800.c @@ -531,7 +531,18 @@ static struct comedi_driver driver_das1800 = { * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_das1800); +static int __init driver_das1800_init_module(void) +{ + return comedi_driver_register(&driver_das1800); +} + +static void __exit driver_das1800_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das1800); +} + +module_init(driver_das1800_init_module); +module_exit(driver_das1800_cleanup_module); static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0, unsigned int dma1) diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c index 3aac876869d..6328f5280b6 100644 --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -109,7 +109,18 @@ static struct comedi_driver driver_das6402 = { .detach = das6402_detach, }; -COMEDI_INITCLEANUP(driver_das6402); +static int __init driver_das6402_init_module(void) +{ + return comedi_driver_register(&driver_das6402); +} + +static void __exit driver_das6402_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das6402); +} + +module_init(driver_das6402_init_module); +module_exit(driver_das6402_cleanup_module); struct das6402_private { int ai_bytes_to_read; diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index b4083af4a66..aecaedc5027 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -347,7 +347,18 @@ static int das800_probe(struct comedi_device *dev) * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_das800); +static int __init driver_das800_init_module(void) +{ + return comedi_driver_register(&driver_das800); +} + +static void __exit driver_das800_cleanup_module(void) +{ + comedi_driver_unregister(&driver_das800); +} + +module_init(driver_das800_init_module); +module_exit(driver_das800_cleanup_module); /* interrupt service routine */ static irqreturn_t das800_interrupt(int irq, void *d) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 572b7a9e867..dcde8d8dd40 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -1095,7 +1095,18 @@ void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec) * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_dmm32at); +static int __init driver_dmm32at_init_module(void) +{ + return comedi_driver_register(&driver_dmm32at); +} + +static void __exit driver_dmm32at_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dmm32at); +} + +module_init(driver_dmm32at_init_module); +module_exit(driver_dmm32at_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index a6f1546b39e..5cce1b5f448 100644 --- a/drivers/staging/comedi/drivers/dt2801.c +++ b/drivers/staging/comedi/drivers/dt2801.c @@ -98,7 +98,18 @@ static struct comedi_driver driver_dt2801 = { .detach = dt2801_detach, }; -COMEDI_INITCLEANUP(driver_dt2801); +static int __init driver_dt2801_init_module(void) +{ + return comedi_driver_register(&driver_dt2801); +} + +static void __exit driver_dt2801_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt2801); +} + +module_init(driver_dt2801_init_module); +module_exit(driver_dt2801_cleanup_module); #if 0 /* ignore 'defined but not used' warning */ diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index 2d103eb1ebc..a1664caa1d9 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -239,7 +239,18 @@ static struct comedi_driver driver_dt2811 = { .offset = sizeof(struct dt2811_board), }; -COMEDI_INITCLEANUP(driver_dt2811); +static int __init driver_dt2811_init_module(void) +{ + return comedi_driver_register(&driver_dt2811); +} + +static void __exit driver_dt2811_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt2811); +} + +module_init(driver_dt2811_init_module); +module_exit(driver_dt2811_cleanup_module); static int dt2811_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index 0871fe0dc46..1c6248cf592 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -70,7 +70,18 @@ static struct comedi_driver driver_dt2814 = { .detach = dt2814_detach, }; -COMEDI_INITCLEANUP(driver_dt2814); +static int __init driver_dt2814_init_module(void) +{ + return comedi_driver_register(&driver_dt2814); +} + +static void __exit driver_dt2814_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt2814); +} + +module_init(driver_dt2814_init_module); +module_exit(driver_dt2814_cleanup_module); static irqreturn_t dt2814_interrupt(int irq, void *dev); diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c index 8ff420eda1b..4155da43fd5 100644 --- a/drivers/staging/comedi/drivers/dt2815.c +++ b/drivers/staging/comedi/drivers/dt2815.c @@ -82,7 +82,18 @@ static struct comedi_driver driver_dt2815 = { .detach = dt2815_detach, }; -COMEDI_INITCLEANUP(driver_dt2815); +static int __init driver_dt2815_init_module(void) +{ + return comedi_driver_register(&driver_dt2815); +} + +static void __exit driver_dt2815_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt2815); +} + +module_init(driver_dt2815_init_module); +module_exit(driver_dt2815_cleanup_module); static void dt2815_free_resources(struct comedi_device *dev); diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index 019aa4dfeeb..651fe050d02 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c @@ -57,7 +57,18 @@ static struct comedi_driver driver_dt2817 = { .detach = dt2817_detach, }; -COMEDI_INITCLEANUP(driver_dt2817); +static int __init driver_dt2817_init_module(void) +{ + return comedi_driver_register(&driver_dt2817); +} + +static void __exit driver_dt2817_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt2817); +} + +module_init(driver_dt2817_init_module); +module_exit(driver_dt2817_cleanup_module); static int dt2817_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c index 58a2fdfcd34..8cea9dca3d7 100644 --- a/drivers/staging/comedi/drivers/dt282x.c +++ b/drivers/staging/comedi/drivers/dt282x.c @@ -423,7 +423,18 @@ static struct comedi_driver driver_dt282x = { .offset = sizeof(struct dt282x_board), }; -COMEDI_INITCLEANUP(driver_dt282x); +static int __init driver_dt282x_init_module(void) +{ + return comedi_driver_register(&driver_dt282x); +} + +static void __exit driver_dt282x_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dt282x); +} + +module_init(driver_dt282x_init_module); +module_exit(driver_dt282x_cleanup_module); static void free_resources(struct comedi_device *dev); static int prep_ai_dma(struct comedi_device *dev, int chan, int size); diff --git a/drivers/staging/comedi/drivers/fl512.c b/drivers/staging/comedi/drivers/fl512.c index 19f01843861..7f49add60b2 100644 --- a/drivers/staging/comedi/drivers/fl512.c +++ b/drivers/staging/comedi/drivers/fl512.c @@ -52,7 +52,18 @@ static struct comedi_driver driver_fl512 = { .detach = fl512_detach, }; -COMEDI_INITCLEANUP(driver_fl512); +static int __init driver_fl512_init_module(void) +{ + return comedi_driver_register(&driver_fl512); +} + +static void __exit driver_fl512_cleanup_module(void) +{ + comedi_driver_unregister(&driver_fl512); +} + +module_init(driver_fl512_init_module); +module_exit(driver_fl512_cleanup_module); static int fl512_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, diff --git a/drivers/staging/comedi/drivers/icp_multi.c b/drivers/staging/comedi/drivers/icp_multi.c index ba42478e6e1..809d17efd5b 100644 --- a/drivers/staging/comedi/drivers/icp_multi.c +++ b/drivers/staging/comedi/drivers/icp_multi.c @@ -185,7 +185,18 @@ board_name : &boardtypes[0].name, offset : sizeof(struct boardtype), }; -COMEDI_INITCLEANUP(driver_icp_multi); +static int __init driver_icp_multi_init_module(void) +{ + return comedi_driver_register(&driver_icp_multi); +} + +static void __exit driver_icp_multi_cleanup_module(void) +{ + comedi_driver_unregister(&driver_icp_multi); +} + +module_init(driver_icp_multi_init_module); +module_exit(driver_icp_multi_cleanup_module); struct icp_multi_private { struct pcilst_struct *card; /* pointer to card */ diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 0951f0e28a6..39a6a850d63 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -640,7 +640,18 @@ static unsigned int pci20xxx_di(struct comedi_device *dev, } #endif -COMEDI_INITCLEANUP(driver_pci20xxx); +static int __init driver_pci20xxx_init_module(void) +{ + return comedi_driver_register(&driver_pci20xxx); +} + +static void __exit driver_pci20xxx_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pci20xxx); +} + +module_init(driver_pci20xxx_init_module); +module_exit(driver_pci20xxx_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index df001e1738a..a89eebd23f6 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -406,7 +406,18 @@ static int mpc624_ai_rinsn(struct comedi_device *dev, return n; } -COMEDI_INITCLEANUP(driver_mpc624); +static int __init driver_mpc624_init_module(void) +{ + return comedi_driver_register(&driver_mpc624); +} + +static void __exit driver_mpc624_cleanup_module(void) +{ + comedi_driver_unregister(&driver_mpc624); +} + +module_init(driver_mpc624_init_module); +module_exit(driver_mpc624_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/mpc8260cpm.c b/drivers/staging/comedi/drivers/mpc8260cpm.c index 440a144a037..5f6816a3fe8 100644 --- a/drivers/staging/comedi/drivers/mpc8260cpm.c +++ b/drivers/staging/comedi/drivers/mpc8260cpm.c @@ -56,7 +56,18 @@ static struct comedi_driver driver_mpc8260cpm = { .detach = mpc8260cpm_detach, }; -COMEDI_INITCLEANUP(driver_mpc8260cpm); +static int __init driver_mpc8260cpm_init_module(void) +{ + return comedi_driver_register(&driver_mpc8260cpm); +} + +static void __exit driver_mpc8260cpm_cleanup_module(void) +{ + comedi_driver_unregister(&driver_mpc8260cpm); +} + +module_init(driver_mpc8260cpm_init_module); +module_exit(driver_mpc8260cpm_cleanup_module); static int mpc8260cpm_dio_config(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/multiq3.c b/drivers/staging/comedi/drivers/multiq3.c index 41bc51da388..dace902d3bc 100644 --- a/drivers/staging/comedi/drivers/multiq3.c +++ b/drivers/staging/comedi/drivers/multiq3.c @@ -93,7 +93,18 @@ static struct comedi_driver driver_multiq3 = { .detach = multiq3_detach, }; -COMEDI_INITCLEANUP(driver_multiq3); +static int __init driver_multiq3_init_module(void) +{ + return comedi_driver_register(&driver_multiq3); +} + +static void __exit driver_multiq3_cleanup_module(void) +{ + comedi_driver_unregister(&driver_multiq3); +} + +module_init(driver_multiq3_init_module); +module_exit(driver_multiq3_cleanup_module); struct multiq3_private { unsigned int ao_readback[2]; diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 709fc85ac70..e46d62b75fc 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -197,7 +197,18 @@ static int a2150_set_chanlist(struct comedi_device *dev, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_a2150); +static int __init driver_a2150_init_module(void) +{ + return comedi_driver_register(&driver_a2150); +} + +static void __exit driver_a2150_cleanup_module(void) +{ + comedi_driver_unregister(&driver_a2150); +} + +module_init(driver_a2150_init_module); +module_exit(driver_a2150_cleanup_module); #ifdef A2150_DEBUG diff --git a/drivers/staging/comedi/drivers/ni_at_ao.c b/drivers/staging/comedi/drivers/ni_at_ao.c index be1ddf28a54..138dcc2275a 100644 --- a/drivers/staging/comedi/drivers/ni_at_ao.c +++ b/drivers/staging/comedi/drivers/ni_at_ao.c @@ -194,7 +194,18 @@ static struct comedi_driver driver_atao = { .num_names = ARRAY_SIZE(atao_boards), }; -COMEDI_INITCLEANUP(driver_atao); +static int __init driver_atao_init_module(void) +{ + return comedi_driver_register(&driver_atao); +} + +static void __exit driver_atao_cleanup_module(void) +{ + comedi_driver_unregister(&driver_atao); +} + +module_init(driver_atao_init_module); +module_exit(driver_atao_cleanup_module); static void atao_reset(struct comedi_device *dev); diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 003d00b595b..3330b3d53e8 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -349,7 +349,18 @@ static struct comedi_driver driver_atmio = { .detach = ni_atmio_detach, }; -COMEDI_INITCLEANUP(driver_atmio); +static int __init driver_atmio_init_module(void) +{ + return comedi_driver_register(&driver_atmio); +} + +static void __exit driver_atmio_cleanup_module(void) +{ + comedi_driver_unregister(&driver_atmio); +} + +module_init(driver_atmio_init_module); +module_exit(driver_atmio_cleanup_module); #include "ni_mio_common.c" diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c b/drivers/staging/comedi/drivers/ni_atmio16d.c index 78fdf7bfb33..285b933551a 100644 --- a/drivers/staging/comedi/drivers/ni_atmio16d.c +++ b/drivers/staging/comedi/drivers/ni_atmio16d.c @@ -151,7 +151,18 @@ static struct comedi_driver driver_atmio16d = { .offset = sizeof(struct atmio16_board_t), }; -COMEDI_INITCLEANUP(driver_atmio16d); +static int __init driver_atmio16d_init_module(void) +{ + return comedi_driver_register(&driver_atmio16d); +} + +static void __exit driver_atmio16d_cleanup_module(void) +{ + comedi_driver_unregister(&driver_atmio16d); +} + +module_init(driver_atmio16d_init_module); +module_exit(driver_atmio16d_cleanup_module); /* range structs */ static const struct comedi_lrange range_atmio16d_ai_10_bipolar = { 4, { diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 4966c8e496d..383ee1024ad 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -2080,7 +2080,18 @@ static void write_caldac(struct comedi_device *dev, unsigned int channel, #ifdef CONFIG_COMEDI_PCI COMEDI_PCI_INITCLEANUP(driver_labpc, labpc_pci_table); #else -COMEDI_INITCLEANUP(driver_labpc); +static int __init driver_labpc_init_module(void) +{ + return comedi_driver_register(&driver_labpc); +} + +static void __exit driver_labpc_cleanup_module(void) +{ + comedi_driver_unregister(&driver_labpc); +} + +module_init(driver_labpc_init_module); +module_exit(driver_labpc_cleanup_module); #endif EXPORT_SYMBOL_GPL(labpc_common_attach); diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c index 870c40a7546..22d14fb3121 100644 --- a/drivers/staging/comedi/drivers/pcl711.c +++ b/drivers/staging/comedi/drivers/pcl711.c @@ -171,7 +171,18 @@ static struct comedi_driver driver_pcl711 = { .offset = sizeof(struct pcl711_board), }; -COMEDI_INITCLEANUP(driver_pcl711); +static int __init driver_pcl711_init_module(void) +{ + return comedi_driver_register(&driver_pcl711); +} + +static void __exit driver_pcl711_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl711); +} + +module_init(driver_pcl711_init_module); +module_exit(driver_pcl711_cleanup_module); struct pcl711_private { diff --git a/drivers/staging/comedi/drivers/pcl724.c b/drivers/staging/comedi/drivers/pcl724.c index 2811060b424..396a058bb67 100644 --- a/drivers/staging/comedi/drivers/pcl724.c +++ b/drivers/staging/comedi/drivers/pcl724.c @@ -93,7 +93,18 @@ static struct comedi_driver driver_pcl724 = { .offset = sizeof(struct pcl724_board), }; -COMEDI_INITCLEANUP(driver_pcl724); +static int __init driver_pcl724_init_module(void) +{ + return comedi_driver_register(&driver_pcl724); +} + +static void __exit driver_pcl724_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl724); +} + +module_init(driver_pcl724_init_module); +module_exit(driver_pcl724_cleanup_module); static int subdev_8255_cb(int dir, int port, int data, unsigned long arg) { diff --git a/drivers/staging/comedi/drivers/pcl725.c b/drivers/staging/comedi/drivers/pcl725.c index cab4c13fff9..24b223ca439 100644 --- a/drivers/staging/comedi/drivers/pcl725.c +++ b/drivers/staging/comedi/drivers/pcl725.c @@ -30,7 +30,18 @@ static struct comedi_driver driver_pcl725 = { .detach = pcl725_detach, }; -COMEDI_INITCLEANUP(driver_pcl725); +static int __init driver_pcl725_init_module(void) +{ + return comedi_driver_register(&driver_pcl725); +} + +static void __exit driver_pcl725_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl725); +} + +module_init(driver_pcl725_init_module); +module_exit(driver_pcl725_cleanup_module); static int pcl725_do_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) diff --git a/drivers/staging/comedi/drivers/pcl726.c b/drivers/staging/comedi/drivers/pcl726.c index e54463136cc..897cd808eeb 100644 --- a/drivers/staging/comedi/drivers/pcl726.c +++ b/drivers/staging/comedi/drivers/pcl726.c @@ -162,7 +162,18 @@ static struct comedi_driver driver_pcl726 = { .offset = sizeof(struct pcl726_board), }; -COMEDI_INITCLEANUP(driver_pcl726); +static int __init driver_pcl726_init_module(void) +{ + return comedi_driver_register(&driver_pcl726); +} + +static void __exit driver_pcl726_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl726); +} + +module_init(driver_pcl726_init_module); +module_exit(driver_pcl726_cleanup_module); struct pcl726_private { diff --git a/drivers/staging/comedi/drivers/pcl730.c b/drivers/staging/comedi/drivers/pcl730.c index 7d4f29a7142..c9682d614e0 100644 --- a/drivers/staging/comedi/drivers/pcl730.c +++ b/drivers/staging/comedi/drivers/pcl730.c @@ -55,7 +55,18 @@ static struct comedi_driver driver_pcl730 = { .offset = sizeof(struct pcl730_board), }; -COMEDI_INITCLEANUP(driver_pcl730); +static int __init driver_pcl730_init_module(void) +{ + return comedi_driver_register(&driver_pcl730); +} + +static void __exit driver_pcl730_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl730); +} + +module_init(driver_pcl730_init_module); +module_exit(driver_pcl730_cleanup_module); static int pcl730_do_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c index b82c37c5d16..943fb713bd7 100644 --- a/drivers/staging/comedi/drivers/pcl812.c +++ b/drivers/staging/comedi/drivers/pcl812.c @@ -407,7 +407,18 @@ static struct comedi_driver driver_pcl812 = { .offset = sizeof(struct pcl812_board), }; -COMEDI_INITCLEANUP(driver_pcl812); +static int __init driver_pcl812_init_module(void) +{ + return comedi_driver_register(&driver_pcl812); +} + +static void __exit driver_pcl812_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl812); +} + +module_init(driver_pcl812_init_module); +module_exit(driver_pcl812_cleanup_module); struct pcl812_private { diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index c26dfad2c89..a84b942c5a9 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c @@ -168,7 +168,18 @@ static struct comedi_driver driver_pcl816 = { .offset = sizeof(struct pcl816_board), }; -COMEDI_INITCLEANUP(driver_pcl816); +static int __init driver_pcl816_init_module(void) +{ + return comedi_driver_register(&driver_pcl816); +} + +static void __exit driver_pcl816_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl816); +} + +module_init(driver_pcl816_init_module); +module_exit(driver_pcl816_cleanup_module); struct pcl816_private { diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index 887f1c37aa6..d2bd6f82b83 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -313,7 +313,18 @@ static struct comedi_driver driver_pcl818 = { .offset = sizeof(struct pcl818_board), }; -COMEDI_INITCLEANUP(driver_pcl818); +static int __init driver_pcl818_init_module(void) +{ + return comedi_driver_register(&driver_pcl818); +} + +static void __exit driver_pcl818_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcl818); +} + +module_init(driver_pcl818_init_module); +module_exit(driver_pcl818_cleanup_module); struct pcl818_private { diff --git a/drivers/staging/comedi/drivers/pcm3724.c b/drivers/staging/comedi/drivers/pcm3724.c index 972cd2bdf45..26850954442 100644 --- a/drivers/staging/comedi/drivers/pcm3724.c +++ b/drivers/staging/comedi/drivers/pcm3724.c @@ -97,7 +97,18 @@ static struct comedi_driver driver_pcm3724 = { .offset = sizeof(struct pcm3724_board), }; -COMEDI_INITCLEANUP(driver_pcm3724); +static int __init driver_pcm3724_init_module(void) +{ + return comedi_driver_register(&driver_pcm3724); +} + +static void __exit driver_pcm3724_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcm3724); +} + +module_init(driver_pcm3724_init_module); +module_exit(driver_pcm3724_cleanup_module); /* (setq c-basic-offset 8) */ diff --git a/drivers/staging/comedi/drivers/pcm3730.c b/drivers/staging/comedi/drivers/pcm3730.c index 3c826b7b8e7..bada6b236ff 100644 --- a/drivers/staging/comedi/drivers/pcm3730.c +++ b/drivers/staging/comedi/drivers/pcm3730.c @@ -38,7 +38,18 @@ static struct comedi_driver driver_pcm3730 = { .detach = pcm3730_detach, }; -COMEDI_INITCLEANUP(driver_pcm3730); +static int __init driver_pcm3730_init_module(void) +{ + return comedi_driver_register(&driver_pcm3730); +} + +static void __exit driver_pcm3730_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcm3730); +} + +module_init(driver_pcm3730_init_module); +module_exit(driver_pcm3730_cleanup_module); static int pcm3730_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c index 9f63a6cacfc..23b3d777340 100644 --- a/drivers/staging/comedi/drivers/pcmad.c +++ b/drivers/staging/comedi/drivers/pcmad.c @@ -89,7 +89,18 @@ static struct comedi_driver driver_pcmad = { .offset = sizeof(pcmad_boards[0]), }; -COMEDI_INITCLEANUP(driver_pcmad); +static int __init driver_pcmad_init_module(void) +{ + return comedi_driver_register(&driver_pcmad); +} + +static void __exit driver_pcmad_cleanup_module(void) +{ + comedi_driver_unregister(&driver_pcmad); +} + +module_init(driver_pcmad_init_module); +module_exit(driver_pcmad_cleanup_module); #define TIMEOUT 100 diff --git a/drivers/staging/comedi/drivers/pcmda12.c b/drivers/staging/comedi/drivers/pcmda12.c index b09c0da8690..6d6b86ad817 100644 --- a/drivers/staging/comedi/drivers/pcmda12.c +++ b/drivers/staging/comedi/drivers/pcmda12.c @@ -303,7 +303,18 @@ static int ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver); +static int __init driver_init_module(void) +{ + return comedi_driver_register(&driver); +} + +static void __exit driver_cleanup_module(void) +{ + comedi_driver_unregister(&driver); +} + +module_init(driver_init_module); +module_exit(driver_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c index 3e80da04277..f0df9d1e4fe 100644 --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -1333,7 +1333,18 @@ static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver); +static int __init driver_init_module(void) +{ + return comedi_driver_register(&driver); +} + +static void __exit driver_cleanup_module(void) +{ + comedi_driver_unregister(&driver); +} + +module_init(driver_init_module); +module_exit(driver_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 785b3ec8fec..7a9287433b2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -1018,7 +1018,18 @@ pcmuio_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver); +static int __init driver_init_module(void) +{ + return comedi_driver_register(&driver); +} + +static void __exit driver_cleanup_module(void) +{ + comedi_driver_unregister(&driver); +} + +module_init(driver_init_module); +module_exit(driver_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/poc.c b/drivers/staging/comedi/drivers/poc.c index 9270b9f1582..831a576c24a 100644 --- a/drivers/staging/comedi/drivers/poc.c +++ b/drivers/staging/comedi/drivers/poc.c @@ -248,7 +248,18 @@ static int pcl734_insn_bits(struct comedi_device *dev, return 2; } -COMEDI_INITCLEANUP(driver_poc); +static int __init driver_poc_init_module(void) +{ + return comedi_driver_register(&driver_poc); +} + +static void __exit driver_poc_cleanup_module(void) +{ + comedi_driver_unregister(&driver_poc); +} + +module_init(driver_poc_init_module); +module_exit(driver_poc_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c index 4add6332850..72042b81831 100644 --- a/drivers/staging/comedi/drivers/rti800.c +++ b/drivers/staging/comedi/drivers/rti800.c @@ -158,7 +158,18 @@ static struct comedi_driver driver_rti800 = { .offset = sizeof(struct rti800_board), }; -COMEDI_INITCLEANUP(driver_rti800); +static int __init driver_rti800_init_module(void) +{ + return comedi_driver_register(&driver_rti800); +} + +static void __exit driver_rti800_cleanup_module(void) +{ + comedi_driver_unregister(&driver_rti800); +} + +module_init(driver_rti800_init_module); +module_exit(driver_rti800_cleanup_module); static irqreturn_t rti800_interrupt(int irq, void *dev); diff --git a/drivers/staging/comedi/drivers/rti802.c b/drivers/staging/comedi/drivers/rti802.c index 132415b2d00..f59cb11590f 100644 --- a/drivers/staging/comedi/drivers/rti802.c +++ b/drivers/staging/comedi/drivers/rti802.c @@ -57,7 +57,18 @@ static struct comedi_driver driver_rti802 = { .detach = rti802_detach, }; -COMEDI_INITCLEANUP(driver_rti802); +static int __init driver_rti802_init_module(void) +{ + return comedi_driver_register(&driver_rti802); +} + +static void __exit driver_rti802_cleanup_module(void) +{ + comedi_driver_unregister(&driver_rti802); +} + +module_init(driver_rti802_init_module); +module_exit(driver_rti802_cleanup_module); struct rti802_private { enum { diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c index 8afed1307bd..3607aaee4af 100644 --- a/drivers/staging/comedi/drivers/s526.c +++ b/drivers/staging/comedi/drivers/s526.c @@ -1002,7 +1002,18 @@ static int s526_dio_insn_config(struct comedi_device *dev, * A convenient macro that defines init_module() and cleanup_module(), * as necessary. */ -COMEDI_INITCLEANUP(driver_s526); +static int __init driver_s526_init_module(void) +{ + return comedi_driver_register(&driver_s526); +} + +static void __exit driver_s526_cleanup_module(void) +{ + comedi_driver_unregister(&driver_s526); +} + +module_init(driver_s526_init_module); +module_exit(driver_s526_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index 85d127fb7eb..c9be9e05f02 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -917,7 +917,18 @@ static int serial2002_detach(struct comedi_device *dev) return 0; } -COMEDI_INITCLEANUP(driver_serial2002); +static int __init driver_serial2002_init_module(void) +{ + return comedi_driver_register(&driver_serial2002); +} + +static void __exit driver_serial2002_cleanup_module(void) +{ + comedi_driver_unregister(&driver_serial2002); +} + +module_init(driver_serial2002_init_module); +module_exit(driver_serial2002_cleanup_module); MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_DESCRIPTION("Comedi low-level driver"); diff --git a/drivers/staging/comedi/drivers/skel.c b/drivers/staging/comedi/drivers/skel.c index 5a0767333bb..d1d5437c599 100644 --- a/drivers/staging/comedi/drivers/skel.c +++ b/drivers/staging/comedi/drivers/skel.c @@ -620,11 +620,18 @@ static int skel_dio_insn_config(struct comedi_device *dev, return insn->n; } -/* - * A convenient macro that defines init_module() and cleanup_module(), - * as necessary. - */ -COMEDI_INITCLEANUP(driver_skel); +static int __init driver_skel_init_module(void) +{ + return comedi_driver_register(&driver_skel); +} + +static void __exit driver_skel_cleanup_module(void) +{ + comedi_driver_unregister(&driver_skel); +} + +module_init(driver_skel_init_module); +module_exit(driver_skel_cleanup_module); /* If you are writing a PCI driver you should use COMEDI_PCI_INITCLEANUP * instead. */ diff --git a/drivers/staging/comedi/drivers/ssv_dnp.c b/drivers/staging/comedi/drivers/ssv_dnp.c index ce0cbb4c37b..526de2efa12 100644 --- a/drivers/staging/comedi/drivers/ssv_dnp.c +++ b/drivers/staging/comedi/drivers/ssv_dnp.c @@ -102,7 +102,18 @@ static struct comedi_driver driver_dnp = { .num_names = ARRAY_SIZE(dnp_boards), }; -COMEDI_INITCLEANUP(driver_dnp); +static int __init driver_dnp_init_module(void) +{ + return comedi_driver_register(&driver_dnp); +} + +static void __exit driver_dnp_cleanup_module(void) +{ + comedi_driver_unregister(&driver_dnp); +} + +module_init(driver_dnp_init_module); +module_exit(driver_dnp_cleanup_module); static int dnp_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, diff --git a/drivers/staging/comedi/drivers/unioxx5.c b/drivers/staging/comedi/drivers/unioxx5.c index 1aca98895f8..598884ec3ed 100644 --- a/drivers/staging/comedi/drivers/unioxx5.c +++ b/drivers/staging/comedi/drivers/unioxx5.c @@ -114,7 +114,18 @@ static struct comedi_driver unioxx5_driver = { .detach = unioxx5_detach }; -COMEDI_INITCLEANUP(unioxx5_driver); +static int __init unioxx5_driver_init_module(void) +{ + return comedi_driver_register(&unioxx5_driver); +} + +static void __exit unioxx5_driver_cleanup_module(void) +{ + comedi_driver_unregister(&unioxx5_driver); +} + +module_init(unioxx5_driver_init_module); +module_exit(unioxx5_driver_cleanup_module); static int unioxx5_attach(struct comedi_device *dev, struct comedi_devconfig *it) -- 2.20.1