Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro
authorArun Thomas <arun.thomas@gmail.com>
Sun, 6 Jun 2010 20:23:31 +0000 (22:23 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Jun 2010 20:48:12 +0000 (13:48 -0700)
Move the PCI devinit/devexit routines to the respective C source files
instead of calling COMEDI_PCI_INITCLEANUP

Signed-off-by: Arun Thomas <arun.thomas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
42 files changed:
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci7230.c
drivers/staging/comedi/drivers/adl_pci7296.c
drivers/staging/comedi/drivers/adl_pci7432.c
drivers/staging/comedi/drivers/adl_pci8164.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/amplc_pc263.c
drivers/staging/comedi/drivers/amplc_pci224.c
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/cb_pcidda.c
drivers/staging/comedi/drivers/cb_pcidio.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/contec_pci_dio.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/ke_counter.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_670x.c
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_pcimio.c
drivers/staging/comedi/drivers/rtd520.c
drivers/staging/comedi/drivers/s626.c
drivers/staging/comedi/drivers/skel.c

index 8e0106520c2faf13d3adeecfb9172f71dc6f81f6..68aa9176d2490c821d4e94ccec459df53390f964 100644 (file)
        COMEDI_MINORVERSION, COMEDI_MICROVERSION)
 #define COMEDI_RELEASE VERSION
 
-#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) \
-       { \
-               return comedi_pci_auto_config(dev, comedi_driver.driver_name); \
-       } \
-       static void __devexit comedi_driver ## _pci_remove(\
-               struct pci_dev *dev) \
-       { \
-               comedi_pci_auto_unconfig(dev); \
-       } \
-       static struct pci_driver comedi_driver ## _pci_driver = \
-       { \
-               .id_table = pci_id_table, \
-               .probe = &comedi_driver ## _pci_probe, \
-               .remove = __devexit_p(&comedi_driver ## _pci_remove) \
-       }; \
-       static int __init comedi_driver ## _init_module(void) \
-       { \
-               int retval; \
-               retval = comedi_driver_register(&comedi_driver); \
-               if (retval < 0) \
-                       return retval; \
-                       comedi_driver ## _pci_driver.name = \
-                               (char *)comedi_driver.driver_name; \
-               return pci_register_driver(&comedi_driver ## _pci_driver); \
-       } \
-       static void __exit comedi_driver ## _cleanup_module(void) \
-       { \
-               pci_unregister_driver(&comedi_driver ## _pci_driver); \
-               comedi_driver_unregister(&comedi_driver); \
-       } \
-       module_init(comedi_driver ## _init_module); \
-       module_exit(comedi_driver ## _cleanup_module);
-
-#define COMEDI_PCI_INITCLEANUP(comedi_driver, pci_id_table) \
-       COMEDI_PCI_INITCLEANUP_NOMODULE(comedi_driver, pci_id_table)
-
 #define PCI_VENDOR_ID_ADLINK           0x144a
 #define PCI_VENDOR_ID_ICP              0x104c
 #define PCI_VENDOR_ID_CONTEC           0x1221
index b18e81d8cf8a5187fc4bc41afc974b5eb91ccbae..5ed4b9451f2873f77777f4cd7d96882ec8aa156d 100644 (file)
@@ -2541,7 +2541,43 @@ static struct comedi_driver driver_addi = {
        .offset = sizeof(struct addi_board),
 };
 
-COMEDI_PCI_INITCLEANUP(driver_addi, addi_apci_tbl);
+static int __devinit driver_addi_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_addi.driver_name);
+}
+
+static void __devexit driver_addi_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_addi_pci_driver = {
+       .id_table = addi_apci_tbl,
+       .probe = &driver_addi_pci_probe,
+       .remove = __devexit_p(&driver_addi_pci_remove)
+};
+
+static int __init driver_addi_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_addi);
+       if (retval < 0)
+               return retval;
+
+       driver_addi_pci_driver.name = (char *)driver_addi.driver_name;
+       return pci_register_driver(&driver_addi_pci_driver);
+}
+
+static void __exit driver_addi_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_addi_pci_driver);
+       comedi_driver_unregister(&driver_addi);
+}
+
+module_init(driver_addi_init_module);
+module_exit(driver_addi_cleanup_module);
 
 /*
 +----------------------------------------------------------------------------+
index 3816115b18cec19cd54cdc87524d1926469300db..0bc6ac2b6424e62eb73b4e2e475f231b18622188 100644 (file)
@@ -119,7 +119,43 @@ static struct comedi_driver driver_pci6208 = {
        .detach = pci6208_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_pci6208, pci6208_pci_table);
+static int __devinit driver_pci6208_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci6208.driver_name);
+}
+
+static void __devexit driver_pci6208_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pci6208_pci_driver = {
+       .id_table = pci6208_pci_table,
+       .probe = &driver_pci6208_pci_probe,
+       .remove = __devexit_p(&driver_pci6208_pci_remove)
+};
+
+static int __init driver_pci6208_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pci6208);
+       if (retval < 0)
+               return retval;
+
+       driver_pci6208_pci_driver.name = (char *)driver_pci6208.driver_name;
+       return pci_register_driver(&driver_pci6208_pci_driver);
+}
+
+static void __exit driver_pci6208_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci6208_pci_driver);
+       comedi_driver_unregister(&driver_pci6208);
+}
+
+module_init(driver_pci6208_init_module);
+module_exit(driver_pci6208_cleanup_module);
 
 static int pci6208_find_device(struct comedi_device *dev, int bus, int slot);
 static int
index 46b5c5c27621de79dc59a65173c264ed2af5c53a..caeb4e11ac59855b4c1fdeb5880eee8a48036ffb 100644 (file)
@@ -203,7 +203,45 @@ static int adl_pci7230_di_insn_bits(struct comedi_device *dev,
        return 2;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_adl_pci7230, adl_pci7230_pci_table);
+static int __devinit driver_adl_pci7230_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_adl_pci7230.driver_name);
+}
+
+static void __devexit driver_adl_pci7230_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_adl_pci7230_pci_driver = {
+       .id_table = adl_pci7230_pci_table,
+       .probe = &driver_adl_pci7230_pci_probe,
+       .remove = __devexit_p(&driver_adl_pci7230_pci_remove)
+};
+
+static int __init driver_adl_pci7230_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_adl_pci7230);
+       if (retval < 0)
+               return retval;
+
+       driver_adl_pci7230_pci_driver.name =
+           (char *)driver_adl_pci7230.driver_name;
+       return pci_register_driver(&driver_adl_pci7230_pci_driver);
+}
+
+static void __exit driver_adl_pci7230_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_adl_pci7230_pci_driver);
+       comedi_driver_unregister(&driver_adl_pci7230);
+}
+
+module_init(driver_adl_pci7230_init_module);
+module_exit(driver_adl_pci7230_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index e7c5d66ccd95077443925787d8fb3d8b8e7931f5..947fae5adb94e28f25a6b04c7ea788dfae494c0c 100644 (file)
@@ -177,7 +177,45 @@ static int adl_pci7296_detach(struct comedi_device *dev)
        return 0;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_adl_pci7296, adl_pci7296_pci_table);
+static int __devinit driver_adl_pci7296_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_adl_pci7296.driver_name);
+}
+
+static void __devexit driver_adl_pci7296_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_adl_pci7296_pci_driver = {
+       .id_table = adl_pci7296_pci_table,
+       .probe = &driver_adl_pci7296_pci_probe,
+       .remove = __devexit_p(&driver_adl_pci7296_pci_remove)
+};
+
+static int __init driver_adl_pci7296_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_adl_pci7296);
+       if (retval < 0)
+               return retval;
+
+       driver_adl_pci7296_pci_driver.name =
+           (char *)driver_adl_pci7296.driver_name;
+       return pci_register_driver(&driver_adl_pci7296_pci_driver);
+}
+
+static void __exit driver_adl_pci7296_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_adl_pci7296_pci_driver);
+       comedi_driver_unregister(&driver_adl_pci7296);
+}
+
+module_init(driver_adl_pci7296_init_module);
+module_exit(driver_adl_pci7296_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index d68fbe2bdad670688a5900947603507412de81f2..3b2f8e3fccd2583acadae0f0f6197232971c5496 100644 (file)
@@ -210,7 +210,45 @@ static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
        return 2;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_adl_pci7432, adl_pci7432_pci_table);
+static int __devinit driver_adl_pci7432_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_adl_pci7432.driver_name);
+}
+
+static void __devexit driver_adl_pci7432_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_adl_pci7432_pci_driver = {
+       .id_table = adl_pci7432_pci_table,
+       .probe = &driver_adl_pci7432_pci_probe,
+       .remove = __devexit_p(&driver_adl_pci7432_pci_remove)
+};
+
+static int __init driver_adl_pci7432_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_adl_pci7432);
+       if (retval < 0)
+               return retval;
+
+       driver_adl_pci7432_pci_driver.name =
+           (char *)driver_adl_pci7432.driver_name;
+       return pci_register_driver(&driver_adl_pci7432_pci_driver);
+}
+
+static void __exit driver_adl_pci7432_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_adl_pci7432_pci_driver);
+       comedi_driver_unregister(&driver_adl_pci7432);
+}
+
+module_init(driver_adl_pci7432_init_module);
+module_exit(driver_adl_pci7432_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 5fafaf0ff9996e7d6d2555648cc9b38f1f888256..1b7155e4895ee3f22cce02903bc8feb42cb64f6e 100644 (file)
@@ -389,7 +389,45 @@ static int adl_pci8164_insn_write_buf1(struct comedi_device *dev,
        return 2;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_adl_pci8164, adl_pci8164_pci_table);
+static int __devinit driver_adl_pci8164_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_adl_pci8164.driver_name);
+}
+
+static void __devexit driver_adl_pci8164_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_adl_pci8164_pci_driver = {
+       .id_table = adl_pci8164_pci_table,
+       .probe = &driver_adl_pci8164_pci_probe,
+       .remove = __devexit_p(&driver_adl_pci8164_pci_remove)
+};
+
+static int __init driver_adl_pci8164_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_adl_pci8164);
+       if (retval < 0)
+               return retval;
+
+       driver_adl_pci8164_pci_driver.name =
+           (char *)driver_adl_pci8164.driver_name;
+       return pci_register_driver(&driver_adl_pci8164_pci_driver);
+}
+
+static void __exit driver_adl_pci8164_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_adl_pci8164_pci_driver);
+       comedi_driver_unregister(&driver_adl_pci8164);
+}
+
+module_init(driver_adl_pci8164_init_module);
+module_exit(driver_adl_pci8164_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 429a551bd5ddca4b60488cc15cee0e31553032d1..38a5752bc4fc49b7862d2f3aa8fc12fa137cf9f7 100644 (file)
@@ -350,7 +350,43 @@ static struct comedi_driver pci9111_driver = {
        .detach = pci9111_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(pci9111_driver, pci9111_pci_table);
+static int __devinit pci9111_driver_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, pci9111_driver.driver_name);
+}
+
+static void __devexit pci9111_driver_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver pci9111_driver_pci_driver = {
+       .id_table = pci9111_pci_table,
+       .probe = &pci9111_driver_pci_probe,
+       .remove = __devexit_p(&pci9111_driver_pci_remove)
+};
+
+static int __init pci9111_driver_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&pci9111_driver);
+       if (retval < 0)
+               return retval;
+
+       pci9111_driver_pci_driver.name = (char *)pci9111_driver.driver_name;
+       return pci_register_driver(&pci9111_driver_pci_driver);
+}
+
+static void __exit pci9111_driver_cleanup_module(void)
+{
+       pci_unregister_driver(&pci9111_driver_pci_driver);
+       comedi_driver_unregister(&pci9111_driver);
+}
+
+module_init(pci9111_driver_init_module);
+module_exit(pci9111_driver_cleanup_module);
 
 /*  Private data structure */
 
index d6c17e268ccdd6dda75e9529c9ee75b61d3e706f..b0e39cb7477482418b46eec89030daeee59ca429 100644 (file)
@@ -289,7 +289,43 @@ static struct comedi_driver driver_pci9118 = {
        .offset = sizeof(struct boardtype),
 };
 
-COMEDI_PCI_INITCLEANUP(driver_pci9118, pci9118_pci_table);
+static int __devinit driver_pci9118_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci9118.driver_name);
+}
+
+static void __devexit driver_pci9118_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pci9118_pci_driver = {
+       .id_table = pci9118_pci_table,
+       .probe = &driver_pci9118_pci_probe,
+       .remove = __devexit_p(&driver_pci9118_pci_remove)
+};
+
+static int __init driver_pci9118_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pci9118);
+       if (retval < 0)
+               return retval;
+
+       driver_pci9118_pci_driver.name = (char *)driver_pci9118.driver_name;
+       return pci_register_driver(&driver_pci9118_pci_driver);
+}
+
+static void __exit driver_pci9118_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci9118_pci_driver);
+       comedi_driver_unregister(&driver_pci9118);
+}
+
+module_init(driver_pci9118_init_module);
+module_exit(driver_pci9118_cleanup_module);
 
 struct pci9118_private {
        unsigned long iobase_a; /* base+size for AMCC chip */
index dbb50cf7e83cab4860f8c345d5b6c71e050cf31b..2791f9037b9889a2ea6cf977906ac6f53cec5607 100644 (file)
@@ -1609,7 +1609,43 @@ static int pci1710_detach(struct comedi_device *dev)
 /*
 ==============================================================================
 */
-COMEDI_PCI_INITCLEANUP(driver_pci1710, pci1710_pci_table);
+static int __devinit driver_pci1710_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci1710.driver_name);
+}
+
+static void __devexit driver_pci1710_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pci1710_pci_driver = {
+       .id_table = pci1710_pci_table,
+       .probe = &driver_pci1710_pci_probe,
+       .remove = __devexit_p(&driver_pci1710_pci_remove)
+};
+
+static int __init driver_pci1710_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pci1710);
+       if (retval < 0)
+               return retval;
+
+       driver_pci1710_pci_driver.name = (char *)driver_pci1710.driver_name;
+       return pci_register_driver(&driver_pci1710_pci_driver);
+}
+
+static void __exit driver_pci1710_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci1710_pci_driver);
+       comedi_driver_unregister(&driver_pci1710);
+}
+
+module_init(driver_pci1710_init_module);
+module_exit(driver_pci1710_cleanup_module);
 /*
 ==============================================================================
 */
index b973249fb2247a0298af40aac5ccb4aa2c02f883..b133bb84c4fe4255bf8b93059674a169399c985d 100644 (file)
@@ -496,7 +496,43 @@ static int pci1723_detach(struct comedi_device *dev)
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_pci1723, pci1723_pci_table);
+static int __devinit driver_pci1723_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci1723.driver_name);
+}
+
+static void __devexit driver_pci1723_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pci1723_pci_driver = {
+       .id_table = pci1723_pci_table,
+       .probe = &driver_pci1723_pci_probe,
+       .remove = __devexit_p(&driver_pci1723_pci_remove)
+};
+
+static int __init driver_pci1723_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pci1723);
+       if (retval < 0)
+               return retval;
+
+       driver_pci1723_pci_driver.name = (char *)driver_pci1723.driver_name;
+       return pci_register_driver(&driver_pci1723_pci_driver);
+}
+
+static void __exit driver_pci1723_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci1723_pci_driver);
+       comedi_driver_unregister(&driver_pci1723);
+}
+
+module_init(driver_pci1723_init_module);
+module_exit(driver_pci1723_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index e7ba1f0b4e68e795d68a3c41979f4da672181b23..d81bbfac695ab8e99f09ad720221a777db77be96 100644 (file)
@@ -1253,7 +1253,43 @@ static int pci_dio_detach(struct comedi_device *dev)
 /*
 ==============================================================================
 */
-COMEDI_PCI_INITCLEANUP(driver_pci_dio, pci_dio_pci_table);
+static int __devinit driver_pci_dio_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci_dio.driver_name);
+}
+
+static void __devexit driver_pci_dio_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pci_dio_pci_driver = {
+       .id_table = pci_dio_pci_table,
+       .probe = &driver_pci_dio_pci_probe,
+       .remove = __devexit_p(&driver_pci_dio_pci_remove)
+};
+
+static int __init driver_pci_dio_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pci_dio);
+       if (retval < 0)
+               return retval;
+
+       driver_pci_dio_pci_driver.name = (char *)driver_pci_dio.driver_name;
+       return pci_register_driver(&driver_pci_dio_pci_driver);
+}
+
+static void __exit driver_pci_dio_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci_dio_pci_driver);
+       comedi_driver_unregister(&driver_pci_dio);
+}
+
+module_init(driver_pci_dio_init_module);
+module_exit(driver_pci_dio_cleanup_module);
 /*
 ==============================================================================
 */
index 674cf1df7e2c464e67351df0579e0da68dd8a807..93bbe4ec318da86e54a89ed72ed408e30c85e493 100644 (file)
@@ -494,7 +494,45 @@ static struct comedi_driver driver_amplc_dio200 = {
 };
 
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_amplc_dio200, dio200_pci_table);
+static int __devinit driver_amplc_dio200_pci_probe(struct pci_dev *dev,
+                                                  const struct pci_device_id
+                                                  *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_dio200.driver_name);
+}
+
+static void __devexit driver_amplc_dio200_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_dio200_pci_driver = {
+       .id_table = dio200_pci_table,
+       .probe = &driver_amplc_dio200_pci_probe,
+       .remove = __devexit_p(&driver_amplc_dio200_pci_remove)
+};
+
+static int __init driver_amplc_dio200_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_amplc_dio200);
+       if (retval < 0)
+               return retval;
+
+       driver_amplc_dio200_pci_driver.name =
+           (char *)driver_amplc_dio200.driver_name;
+       return pci_register_driver(&driver_amplc_dio200_pci_driver);
+}
+
+static void __exit driver_amplc_dio200_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_amplc_dio200_pci_driver);
+       comedi_driver_unregister(&driver_amplc_dio200);
+}
+
+module_init(driver_amplc_dio200_init_module);
+module_exit(driver_amplc_dio200_cleanup_module);
 #else
 static int __init driver_amplc_dio200_init_module(void)
 {
index 5ffee055c9a984c5e0c950eae739ea3d67e8287c..48246cd50d470fa499eca602b553e90c272158bc 100644 (file)
@@ -182,7 +182,45 @@ static struct comedi_driver driver_amplc_pc236 = {
 };
 
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_amplc_pc236, pc236_pci_table);
+static int __devinit driver_amplc_pc236_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_pc236.driver_name);
+}
+
+static void __devexit driver_amplc_pc236_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_pc236_pci_driver = {
+       .id_table = pc236_pci_table,
+       .probe = &driver_amplc_pc236_pci_probe,
+       .remove = __devexit_p(&driver_amplc_pc236_pci_remove)
+};
+
+static int __init driver_amplc_pc236_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_amplc_pc236);
+       if (retval < 0)
+               return retval;
+
+       driver_amplc_pc236_pci_driver.name =
+           (char *)driver_amplc_pc236.driver_name;
+       return pci_register_driver(&driver_amplc_pc236_pci_driver);
+}
+
+static void __exit driver_amplc_pc236_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_amplc_pc236_pci_driver);
+       comedi_driver_unregister(&driver_amplc_pc236);
+}
+
+module_init(driver_amplc_pc236_init_module);
+module_exit(driver_amplc_pc236_cleanup_module);
 #else
 static int __init driver_amplc_pc236_init_module(void)
 {
index 83af437eb4366c68cbbef98d9a3bb6a7291b2800..8a3388079094a6b4f9e5e5ae090ad7cca7810e86 100644 (file)
@@ -432,7 +432,45 @@ static int pc263_dio_insn_config(struct comedi_device *dev,
  * as necessary.
  */
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_amplc_pc263, pc263_pci_table);
+static int __devinit driver_amplc_pc263_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_pc263.driver_name);
+}
+
+static void __devexit driver_amplc_pc263_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_pc263_pci_driver = {
+       .id_table = pc263_pci_table,
+       .probe = &driver_amplc_pc263_pci_probe,
+       .remove = __devexit_p(&driver_amplc_pc263_pci_remove)
+};
+
+static int __init driver_amplc_pc263_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_amplc_pc263);
+       if (retval < 0)
+               return retval;
+
+       driver_amplc_pc263_pci_driver.name =
+           (char *)driver_amplc_pc263.driver_name;
+       return pci_register_driver(&driver_amplc_pc263_pci_driver);
+}
+
+static void __exit driver_amplc_pc263_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_amplc_pc263_pci_driver);
+       comedi_driver_unregister(&driver_amplc_pc263);
+}
+
+module_init(driver_amplc_pc263_init_module);
+module_exit(driver_amplc_pc263_cleanup_module);
 #else
 static int __init driver_amplc_pc263_init_module(void)
 {
index a27e27f5b7b87e0e0b84eadb09df7db883bd55b9..1b5ba1c2725929e3cd50c7692b9b6b50f1ecedbd 100644 (file)
@@ -443,7 +443,45 @@ static struct comedi_driver driver_amplc_pci224 = {
        .num_names = ARRAY_SIZE(pci224_boards),
 };
 
-COMEDI_PCI_INITCLEANUP(driver_amplc_pci224, pci224_pci_table);
+static int __devinit driver_amplc_pci224_pci_probe(struct pci_dev *dev,
+                                                  const struct pci_device_id
+                                                  *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_pci224.driver_name);
+}
+
+static void __devexit driver_amplc_pci224_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_pci224_pci_driver = {
+       .id_table = pci224_pci_table,
+       .probe = &driver_amplc_pci224_pci_probe,
+       .remove = __devexit_p(&driver_amplc_pci224_pci_remove)
+};
+
+static int __init driver_amplc_pci224_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_amplc_pci224);
+       if (retval < 0)
+               return retval;
+
+       driver_amplc_pci224_pci_driver.name =
+           (char *)driver_amplc_pci224.driver_name;
+       return pci_register_driver(&driver_amplc_pci224_pci_driver);
+}
+
+static void __exit driver_amplc_pci224_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_amplc_pci224_pci_driver);
+       comedi_driver_unregister(&driver_amplc_pci224);
+}
+
+module_init(driver_amplc_pci224_init_module);
+module_exit(driver_amplc_pci224_cleanup_module);
 
 /*
  * Called from the 'insn_write' function to perform a single write.
index 53d34147813b98b33a7c8fcdc4ea4b4d8a17c117..b572df718f21d1acca3b9f9b1ca818df412ef3e7 100644 (file)
@@ -617,7 +617,45 @@ static struct comedi_driver driver_amplc_pci230 = {
        .num_names = ARRAY_SIZE(pci230_boards),
 };
 
-COMEDI_PCI_INITCLEANUP(driver_amplc_pci230, pci230_pci_table);
+static int __devinit driver_amplc_pci230_pci_probe(struct pci_dev *dev,
+                                                  const struct pci_device_id
+                                                  *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_pci230.driver_name);
+}
+
+static void __devexit driver_amplc_pci230_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_pci230_pci_driver = {
+       .id_table = pci230_pci_table,
+       .probe = &driver_amplc_pci230_pci_probe,
+       .remove = __devexit_p(&driver_amplc_pci230_pci_remove)
+};
+
+static int __init driver_amplc_pci230_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_amplc_pci230);
+       if (retval < 0)
+               return retval;
+
+       driver_amplc_pci230_pci_driver.name =
+           (char *)driver_amplc_pci230.driver_name;
+       return pci_register_driver(&driver_amplc_pci230_pci_driver);
+}
+
+static void __exit driver_amplc_pci230_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_amplc_pci230_pci_driver);
+       comedi_driver_unregister(&driver_amplc_pci230);
+}
+
+module_init(driver_amplc_pci230_init_module);
+module_exit(driver_amplc_pci230_cleanup_module);
 
 static int pci230_ai_rinsn(struct comedi_device *dev,
                           struct comedi_subdevice *s, struct comedi_insn *insn,
index 04c71704507f859e1beb44e92f794457a5073f33..2d9ad537793e04c464816defb3a39fbfa3faaef3 100644 (file)
@@ -1871,7 +1871,43 @@ static int nvram_read(struct comedi_device *dev, unsigned int address,
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_cb_pcidas, cb_pcidas_pci_table);
+static int __devinit driver_cb_pcidas_pci_probe(struct pci_dev *dev,
+                                               const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_cb_pcidas.driver_name);
+}
+
+static void __devexit driver_cb_pcidas_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_cb_pcidas_pci_driver = {
+       .id_table = cb_pcidas_pci_table,
+       .probe = &driver_cb_pcidas_pci_probe,
+       .remove = __devexit_p(&driver_cb_pcidas_pci_remove)
+};
+
+static int __init driver_cb_pcidas_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_cb_pcidas);
+       if (retval < 0)
+               return retval;
+
+       driver_cb_pcidas_pci_driver.name = (char *)driver_cb_pcidas.driver_name;
+       return pci_register_driver(&driver_cb_pcidas_pci_driver);
+}
+
+static void __exit driver_cb_pcidas_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_cb_pcidas_pci_driver);
+       comedi_driver_unregister(&driver_cb_pcidas);
+}
+
+module_init(driver_cb_pcidas_init_module);
+module_exit(driver_cb_pcidas_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 168a3351164825f3484bfac8f3a384b9a08ff1df..ba7c48ab6d92af631939c7af91b34f01d52ef8d8 100644 (file)
@@ -1237,7 +1237,43 @@ static unsigned int get_ao_divisor(unsigned int ns, unsigned int flags);
 static void load_ao_dma(struct comedi_device *dev,
                        const struct comedi_cmd *cmd);
 
-COMEDI_PCI_INITCLEANUP(driver_cb_pcidas, pcidas64_pci_table);
+static int __devinit driver_cb_pcidas_pci_probe(struct pci_dev *dev,
+                                               const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_cb_pcidas.driver_name);
+}
+
+static void __devexit driver_cb_pcidas_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_cb_pcidas_pci_driver = {
+       .id_table = pcidas64_pci_table,
+       .probe = &driver_cb_pcidas_pci_probe,
+       .remove = __devexit_p(&driver_cb_pcidas_pci_remove)
+};
+
+static int __init driver_cb_pcidas_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_cb_pcidas);
+       if (retval < 0)
+               return retval;
+
+       driver_cb_pcidas_pci_driver.name = (char *)driver_cb_pcidas.driver_name;
+       return pci_register_driver(&driver_cb_pcidas_pci_driver);
+}
+
+static void __exit driver_cb_pcidas_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_cb_pcidas_pci_driver);
+       comedi_driver_unregister(&driver_cb_pcidas);
+}
+
+module_init(driver_cb_pcidas_init_module);
+module_exit(driver_cb_pcidas_cleanup_module);
 
 static unsigned int ai_range_bits_6xxx(const struct comedi_device *dev,
                                       unsigned int range_index)
index 3c2a84e2065ba44325b7310155b5197667d8455a..349c7a61763a456d700bceefb1a91584c973896d 100644 (file)
@@ -857,7 +857,43 @@ static void cb_pcidda_calibrate(struct comedi_device *dev, unsigned int channel,
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_cb_pcidda, cb_pcidda_pci_table);
+static int __devinit driver_cb_pcidda_pci_probe(struct pci_dev *dev,
+                                               const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_cb_pcidda.driver_name);
+}
+
+static void __devexit driver_cb_pcidda_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_cb_pcidda_pci_driver = {
+       .id_table = cb_pcidda_pci_table,
+       .probe = &driver_cb_pcidda_pci_probe,
+       .remove = __devexit_p(&driver_cb_pcidda_pci_remove)
+};
+
+static int __init driver_cb_pcidda_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_cb_pcidda);
+       if (retval < 0)
+               return retval;
+
+       driver_cb_pcidda_pci_driver.name = (char *)driver_cb_pcidda.driver_name;
+       return pci_register_driver(&driver_cb_pcidda_pci_driver);
+}
+
+static void __exit driver_cb_pcidda_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_cb_pcidda_pci_driver);
+       comedi_driver_unregister(&driver_cb_pcidda);
+}
+
+module_init(driver_cb_pcidda_init_module);
+module_exit(driver_cb_pcidda_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 3afba5fd85d6d0bfc1184216c2cf0af100de977b..a9d902f418a17c1ce7368986a23f4921e32b8d0b 100644 (file)
@@ -300,7 +300,43 @@ static int pcidio_detach(struct comedi_device *dev)
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_cb_pcidio, pcidio_pci_table);
+static int __devinit driver_cb_pcidio_pci_probe(struct pci_dev *dev,
+                                               const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_cb_pcidio.driver_name);
+}
+
+static void __devexit driver_cb_pcidio_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_cb_pcidio_pci_driver = {
+       .id_table = pcidio_pci_table,
+       .probe = &driver_cb_pcidio_pci_probe,
+       .remove = __devexit_p(&driver_cb_pcidio_pci_remove)
+};
+
+static int __init driver_cb_pcidio_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_cb_pcidio);
+       if (retval < 0)
+               return retval;
+
+       driver_cb_pcidio_pci_driver.name = (char *)driver_cb_pcidio.driver_name;
+       return pci_register_driver(&driver_cb_pcidio_pci_driver);
+}
+
+static void __exit driver_cb_pcidio_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_cb_pcidio_pci_driver);
+       comedi_driver_unregister(&driver_cb_pcidio);
+}
+
+module_init(driver_cb_pcidio_init_module);
+module_exit(driver_cb_pcidio_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index bb5553d6b360c1d0b29cc4c8def6683b80a625dd..e50b8c259e2cdfa155f8eb5a66d9a5a8b9653962 100644 (file)
@@ -491,7 +491,45 @@ static int cb_pcimdas_ao_rinsn(struct comedi_device *dev,
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_cb_pcimdas, cb_pcimdas_pci_table);
+static int __devinit driver_cb_pcimdas_pci_probe(struct pci_dev *dev,
+                                                const struct pci_device_id
+                                                *ent)
+{
+       return comedi_pci_auto_config(dev, driver_cb_pcimdas.driver_name);
+}
+
+static void __devexit driver_cb_pcimdas_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_cb_pcimdas_pci_driver = {
+       .id_table = cb_pcimdas_pci_table,
+       .probe = &driver_cb_pcimdas_pci_probe,
+       .remove = __devexit_p(&driver_cb_pcimdas_pci_remove)
+};
+
+static int __init driver_cb_pcimdas_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_cb_pcimdas);
+       if (retval < 0)
+               return retval;
+
+       driver_cb_pcimdas_pci_driver.name =
+           (char *)driver_cb_pcimdas.driver_name;
+       return pci_register_driver(&driver_cb_pcimdas_pci_driver);
+}
+
+static void __exit driver_cb_pcimdas_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_cb_pcimdas_pci_driver);
+       comedi_driver_unregister(&driver_cb_pcimdas);
+}
+
+module_init(driver_cb_pcimdas_init_module);
+module_exit(driver_cb_pcimdas_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index f404ec7723e52cb1c3a8481e730c58ad0b8af6db..3160330b1d9eecf5b8875b632507a205a7df4397 100644 (file)
@@ -195,7 +195,45 @@ MODULE_DESCRIPTION("Comedi low-level driver for the Computerboards PCIM-DDA "
                   "series.  Currently only supports PCIM-DDA06-16 (which "
                   "also happens to be the only board in this series. :) ) ");
 MODULE_LICENSE("GPL");
-COMEDI_PCI_INITCLEANUP_NOMODULE(cb_pcimdda_driver, pci_table);
+static int __devinit cb_pcimdda_driver_pci_probe(struct pci_dev *dev,
+                                                const struct pci_device_id
+                                                *ent)
+{
+       return comedi_pci_auto_config(dev, cb_pcimdda_driver.driver_name);
+}
+
+static void __devexit cb_pcimdda_driver_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver cb_pcimdda_driver_pci_driver = {
+       .id_table = pci_table,
+       .probe = &cb_pcimdda_driver_pci_probe,
+       .remove = __devexit_p(&cb_pcimdda_driver_pci_remove)
+};
+
+static int __init cb_pcimdda_driver_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&cb_pcimdda_driver);
+       if (retval < 0)
+               return retval;
+
+       cb_pcimdda_driver_pci_driver.name =
+           (char *)cb_pcimdda_driver.driver_name;
+       return pci_register_driver(&cb_pcimdda_driver_pci_driver);
+}
+
+static void __exit cb_pcimdda_driver_cleanup_module(void)
+{
+       pci_unregister_driver(&cb_pcimdda_driver_pci_driver);
+       comedi_driver_unregister(&cb_pcimdda_driver);
+}
+
+module_init(cb_pcimdda_driver_init_module);
+module_exit(cb_pcimdda_driver_cleanup_module);
 
 static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
                    struct comedi_insn *insn, unsigned int *data);
index a3d55f46f0fbc007a415796617ee88d2ca7d903e..24ac10ce0bae8df184eda15443e98e29ba7ed828 100644 (file)
@@ -232,7 +232,43 @@ static int contec_di_insn_bits(struct comedi_device *dev,
        return 2;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_contec, contec_pci_table);
+static int __devinit driver_contec_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_contec.driver_name);
+}
+
+static void __devexit driver_contec_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_contec_pci_driver = {
+       .id_table = contec_pci_table,
+       .probe = &driver_contec_pci_probe,
+       .remove = __devexit_p(&driver_contec_pci_remove)
+};
+
+static int __init driver_contec_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_contec);
+       if (retval < 0)
+               return retval;
+
+       driver_contec_pci_driver.name = (char *)driver_contec.driver_name;
+       return pci_register_driver(&driver_contec_pci_driver);
+}
+
+static void __exit driver_contec_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_contec_pci_driver);
+       comedi_driver_unregister(&driver_contec);
+}
+
+module_init(driver_contec_init_module);
+module_exit(driver_contec_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 83cde27ab7252935e221bf84e2a5aa28f68c5d30..6af6c8323d56642c2a441a31906ad4eed68b1762 100644 (file)
@@ -887,7 +887,45 @@ static int daqboard2000_detach(struct comedi_device *dev)
        return 0;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_daqboard2000, daqboard2000_pci_table);
+static int __devinit driver_daqboard2000_pci_probe(struct pci_dev *dev,
+                                                  const struct pci_device_id
+                                                  *ent)
+{
+       return comedi_pci_auto_config(dev, driver_daqboard2000.driver_name);
+}
+
+static void __devexit driver_daqboard2000_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_daqboard2000_pci_driver = {
+       .id_table = daqboard2000_pci_table,
+       .probe = &driver_daqboard2000_pci_probe,
+       .remove = __devexit_p(&driver_daqboard2000_pci_remove)
+};
+
+static int __init driver_daqboard2000_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_daqboard2000);
+       if (retval < 0)
+               return retval;
+
+       driver_daqboard2000_pci_driver.name =
+           (char *)driver_daqboard2000.driver_name;
+       return pci_register_driver(&driver_daqboard2000_pci_driver);
+}
+
+static void __exit driver_daqboard2000_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_daqboard2000_pci_driver);
+       comedi_driver_unregister(&driver_daqboard2000);
+}
+
+module_init(driver_daqboard2000_init_module);
+module_exit(driver_daqboard2000_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index c3f1fedc6eb71860891ba7324978fef00c7f6bd0..7e7b1a7d3fe5196e6b5a20d765b36e875689981a 100644 (file)
@@ -1082,7 +1082,43 @@ int das08_common_detach(struct comedi_device *dev)
 EXPORT_SYMBOL_GPL(das08_common_detach);
 
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_das08, das08_pci_table);
+static int __devinit driver_das08_pci_probe(struct pci_dev *dev,
+                                           const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_das08.driver_name);
+}
+
+static void __devexit driver_das08_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_das08_pci_driver = {
+       .id_table = das08_pci_table,
+       .probe = &driver_das08_pci_probe,
+       .remove = __devexit_p(&driver_das08_pci_remove)
+};
+
+static int __init driver_das08_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_das08);
+       if (retval < 0)
+               return retval;
+
+       driver_das08_pci_driver.name = (char *)driver_das08.driver_name;
+       return pci_register_driver(&driver_das08_pci_driver);
+}
+
+static void __exit driver_das08_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_das08_pci_driver);
+       comedi_driver_unregister(&driver_das08);
+}
+
+module_init(driver_das08_init_module);
+module_exit(driver_das08_cleanup_module);
 #else
 static int __init driver_das08_init_module(void)
 {
index 79ea24d2ce5a7930e1023a679991e2731f111725..656e7bbf2fcbad7f05412c6aa3ad255ca4ed6002 100644 (file)
@@ -287,7 +287,43 @@ static struct comedi_driver driver_dt3000 = {
        .detach = dt3000_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_dt3000, dt3k_pci_table);
+static int __devinit driver_dt3000_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_dt3000.driver_name);
+}
+
+static void __devexit driver_dt3000_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_dt3000_pci_driver = {
+       .id_table = dt3k_pci_table,
+       .probe = &driver_dt3000_pci_probe,
+       .remove = __devexit_p(&driver_dt3000_pci_remove)
+};
+
+static int __init driver_dt3000_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_dt3000);
+       if (retval < 0)
+               return retval;
+
+       driver_dt3000_pci_driver.name = (char *)driver_dt3000.driver_name;
+       return pci_register_driver(&driver_dt3000_pci_driver);
+}
+
+static void __exit driver_dt3000_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_dt3000_pci_driver);
+       comedi_driver_unregister(&driver_dt3000);
+}
+
+module_init(driver_dt3000_init_module);
+module_exit(driver_dt3000_cleanup_module);
 
 static void dt3k_ai_empty_fifo(struct comedi_device *dev,
                               struct comedi_subdevice *s);
index a24d0994a195891e7800dc10ac3727c8e14a86ef..1661b57ca2adf90bef66ba0bc66af2d30cda530e 100644 (file)
@@ -345,7 +345,43 @@ static struct comedi_driver driver_hpdi = {
        .detach = hpdi_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_hpdi, hpdi_pci_table);
+static int __devinit driver_hpdi_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_hpdi.driver_name);
+}
+
+static void __devexit driver_hpdi_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_hpdi_pci_driver = {
+       .id_table = hpdi_pci_table,
+       .probe = &driver_hpdi_pci_probe,
+       .remove = __devexit_p(&driver_hpdi_pci_remove)
+};
+
+static int __init driver_hpdi_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_hpdi);
+       if (retval < 0)
+               return retval;
+
+       driver_hpdi_pci_driver.name = (char *)driver_hpdi.driver_name;
+       return pci_register_driver(&driver_hpdi_pci_driver);
+}
+
+static void __exit driver_hpdi_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_hpdi_pci_driver);
+       comedi_driver_unregister(&driver_hpdi);
+}
+
+module_init(driver_hpdi_init_module);
+module_exit(driver_hpdi_cleanup_module);
 
 static int dio_config_insn(struct comedi_device *dev,
                           struct comedi_subdevice *s, struct comedi_insn *insn,
index 35a789226997256c444603c1f97227038d9ee16a..788a01b11d28c4e99c8725a22b2b8e76033af509 100644 (file)
@@ -987,7 +987,43 @@ static int jr3_pci_detach(struct comedi_device *dev)
        return 0;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_jr3_pci, jr3_pci_pci_table);
+static int __devinit driver_jr3_pci_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_jr3_pci.driver_name);
+}
+
+static void __devexit driver_jr3_pci_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_jr3_pci_pci_driver = {
+       .id_table = jr3_pci_pci_table,
+       .probe = &driver_jr3_pci_pci_probe,
+       .remove = __devexit_p(&driver_jr3_pci_pci_remove)
+};
+
+static int __init driver_jr3_pci_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_jr3_pci);
+       if (retval < 0)
+               return retval;
+
+       driver_jr3_pci_pci_driver.name = (char *)driver_jr3_pci.driver_name;
+       return pci_register_driver(&driver_jr3_pci_pci_driver);
+}
+
+static void __exit driver_jr3_pci_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_jr3_pci_pci_driver);
+       comedi_driver_unregister(&driver_jr3_pci);
+}
+
+module_init(driver_jr3_pci_init_module);
+module_exit(driver_jr3_pci_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 35d9869884dbcdb803a26d4022beaa3f9f9b3947..e30aa012369271d0e5c4260374f07e8a1270be66 100644 (file)
@@ -96,7 +96,43 @@ static struct comedi_driver cnt_driver = {
        .detach = cnt_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(cnt_driver, cnt_pci_table);
+static int __devinit cnt_driver_pci_probe(struct pci_dev *dev,
+                                         const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, cnt_driver.driver_name);
+}
+
+static void __devexit cnt_driver_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver cnt_driver_pci_driver = {
+       .id_table = cnt_pci_table,
+       .probe = &cnt_driver_pci_probe,
+       .remove = __devexit_p(&cnt_driver_pci_remove)
+};
+
+static int __init cnt_driver_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&cnt_driver);
+       if (retval < 0)
+               return retval;
+
+       cnt_driver_pci_driver.name = (char *)cnt_driver.driver_name;
+       return pci_register_driver(&cnt_driver_pci_driver);
+}
+
+static void __exit cnt_driver_cleanup_module(void)
+{
+       pci_unregister_driver(&cnt_driver_pci_driver);
+       comedi_driver_unregister(&cnt_driver);
+}
+
+module_init(cnt_driver_init_module);
+module_exit(cnt_driver_cleanup_module);
 
 /*-- counter write ----------------------------------------------------------*/
 
index 58df32676e41f2041668e135266bd27346c6d069..29e04819769e7c0d3fbb93e907378f964024aeff 100644 (file)
@@ -2383,7 +2383,43 @@ static int me4000_cnt_insn_write(struct comedi_device *dev,
        return 1;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_me4000, me4000_pci_table);
+static int __devinit driver_me4000_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_me4000.driver_name);
+}
+
+static void __devexit driver_me4000_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_me4000_pci_driver = {
+       .id_table = me4000_pci_table,
+       .probe = &driver_me4000_pci_probe,
+       .remove = __devexit_p(&driver_me4000_pci_remove)
+};
+
+static int __init driver_me4000_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_me4000);
+       if (retval < 0)
+               return retval;
+
+       driver_me4000_pci_driver.name = (char *)driver_me4000.driver_name;
+       return pci_register_driver(&driver_me4000_pci_driver);
+}
+
+static void __exit driver_me4000_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_me4000_pci_driver);
+       comedi_driver_unregister(&driver_me4000);
+}
+
+module_init(driver_me4000_init_module);
+module_exit(driver_me4000_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index d03c0f79ce45bb6a10585ec4e80013979bd75f79..579e6a5718002acca75e4058f692899995158541 100644 (file)
@@ -257,7 +257,43 @@ static struct comedi_driver me_driver = {
        .detach = me_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(me_driver, me_pci_table);
+static int __devinit me_driver_pci_probe(struct pci_dev *dev,
+                                        const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, me_driver.driver_name);
+}
+
+static void __devexit me_driver_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver me_driver_pci_driver = {
+       .id_table = me_pci_table,
+       .probe = &me_driver_pci_probe,
+       .remove = __devexit_p(&me_driver_pci_remove)
+};
+
+static int __init me_driver_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&me_driver);
+       if (retval < 0)
+               return retval;
+
+       me_driver_pci_driver.name = (char *)me_driver.driver_name;
+       return pci_register_driver(&me_driver_pci_driver);
+}
+
+static void __exit me_driver_cleanup_module(void)
+{
+       pci_unregister_driver(&me_driver_pci_driver);
+       comedi_driver_unregister(&me_driver);
+}
+
+module_init(me_driver_init_module);
+module_exit(me_driver_cleanup_module);
 
 /* Private data structure */
 struct me_private_data {
index 1fc76cc6a28eb0d33b1b64fcd26357818502aafe..14e716e99a5ca0f0168f694e76db2644f9af6cbe 100644 (file)
@@ -490,4 +490,40 @@ static int ni6527_find_device(struct comedi_device *dev, int bus, int slot)
        return -EIO;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_ni6527, ni6527_pci_table);
+static int __devinit driver_ni6527_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_ni6527.driver_name);
+}
+
+static void __devexit driver_ni6527_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_ni6527_pci_driver = {
+       .id_table = ni6527_pci_table,
+       .probe = &driver_ni6527_pci_probe,
+       .remove = __devexit_p(&driver_ni6527_pci_remove)
+};
+
+static int __init driver_ni6527_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_ni6527);
+       if (retval < 0)
+               return retval;
+
+       driver_ni6527_pci_driver.name = (char *)driver_ni6527.driver_name;
+       return pci_register_driver(&driver_ni6527_pci_driver);
+}
+
+static void __exit driver_ni6527_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_ni6527_pci_driver);
+       comedi_driver_unregister(&driver_ni6527);
+}
+
+module_init(driver_ni6527_init_module);
+module_exit(driver_ni6527_cleanup_module);
index d793f5a4ac988c69a23ecedebcd041941a8c08ba..8b8e2aaf77fb49a8233f23c01ed14fca6a9cd69c 100644 (file)
@@ -834,4 +834,40 @@ static int ni_65xx_find_device(struct comedi_device *dev, int bus, int slot)
        return -EIO;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_ni_65xx, ni_65xx_pci_table);
+static int __devinit driver_ni_65xx_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_ni_65xx.driver_name);
+}
+
+static void __devexit driver_ni_65xx_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_ni_65xx_pci_driver = {
+       .id_table = ni_65xx_pci_table,
+       .probe = &driver_ni_65xx_pci_probe,
+       .remove = __devexit_p(&driver_ni_65xx_pci_remove)
+};
+
+static int __init driver_ni_65xx_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_ni_65xx);
+       if (retval < 0)
+               return retval;
+
+       driver_ni_65xx_pci_driver.name = (char *)driver_ni_65xx.driver_name;
+       return pci_register_driver(&driver_ni_65xx_pci_driver);
+}
+
+static void __exit driver_ni_65xx_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_ni_65xx_pci_driver);
+       comedi_driver_unregister(&driver_ni_65xx);
+}
+
+module_init(driver_ni_65xx_init_module);
+module_exit(driver_ni_65xx_cleanup_module);
index 6a6fae53ea0b39fcc8d693b2246bddb431258b6b..523cb29733736aa249cebbb512b9be227686b94e 100644 (file)
@@ -471,7 +471,43 @@ static struct comedi_driver driver_ni_660x = {
        .detach = ni_660x_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_ni_660x, ni_660x_pci_table);
+static int __devinit driver_ni_660x_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_ni_660x.driver_name);
+}
+
+static void __devexit driver_ni_660x_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_ni_660x_pci_driver = {
+       .id_table = ni_660x_pci_table,
+       .probe = &driver_ni_660x_pci_probe,
+       .remove = __devexit_p(&driver_ni_660x_pci_remove)
+};
+
+static int __init driver_ni_660x_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_ni_660x);
+       if (retval < 0)
+               return retval;
+
+       driver_ni_660x_pci_driver.name = (char *)driver_ni_660x.driver_name;
+       return pci_register_driver(&driver_ni_660x_pci_driver);
+}
+
+static void __exit driver_ni_660x_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_ni_660x_pci_driver);
+       comedi_driver_unregister(&driver_ni_660x);
+}
+
+module_init(driver_ni_660x_init_module);
+module_exit(driver_ni_660x_cleanup_module);
 
 static int ni_660x_find_device(struct comedi_device *dev, int bus, int slot);
 static int ni_660x_set_pfi_routing(struct comedi_device *dev, unsigned chan,
index 44ae8368454defbd728fac76146661a8259eefb1..e9f034efdc6fc81ec2b1ace34b09ef21e3cc835d 100644 (file)
@@ -120,7 +120,43 @@ static struct comedi_driver driver_ni_670x = {
        .detach = ni_670x_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_ni_670x, ni_670x_pci_table);
+static int __devinit driver_ni_670x_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_ni_670x.driver_name);
+}
+
+static void __devexit driver_ni_670x_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_ni_670x_pci_driver = {
+       .id_table = ni_670x_pci_table,
+       .probe = &driver_ni_670x_pci_probe,
+       .remove = __devexit_p(&driver_ni_670x_pci_remove)
+};
+
+static int __init driver_ni_670x_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_ni_670x);
+       if (retval < 0)
+               return retval;
+
+       driver_ni_670x_pci_driver.name = (char *)driver_ni_670x.driver_name;
+       return pci_register_driver(&driver_ni_670x_pci_driver);
+}
+
+static void __exit driver_ni_670x_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_ni_670x_pci_driver);
+       comedi_driver_unregister(&driver_ni_670x);
+}
+
+module_init(driver_ni_670x_init_module);
+module_exit(driver_ni_670x_cleanup_module);
 
 static struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
 
index 383ee1024ad389586d104a866475333fa6044d07..170bab60555a3b240e893e44fe78df7e65b557ed 100644 (file)
@@ -2078,7 +2078,43 @@ static void write_caldac(struct comedi_device *dev, unsigned int channel,
 }
 
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_labpc, labpc_pci_table);
+static int __devinit driver_labpc_pci_probe(struct pci_dev *dev,
+                                           const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_labpc.driver_name);
+}
+
+static void __devexit driver_labpc_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_labpc_pci_driver = {
+       .id_table = labpc_pci_table,
+       .probe = &driver_labpc_pci_probe,
+       .remove = __devexit_p(&driver_labpc_pci_remove)
+};
+
+static int __init driver_labpc_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_labpc);
+       if (retval < 0)
+               return retval;
+
+       driver_labpc_pci_driver.name = (char *)driver_labpc.driver_name;
+       return pci_register_driver(&driver_labpc_pci_driver);
+}
+
+static void __exit driver_labpc_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_labpc_pci_driver);
+       comedi_driver_unregister(&driver_labpc);
+}
+
+module_init(driver_labpc_init_module);
+module_exit(driver_labpc_cleanup_module);
 #else
 static int __init driver_labpc_init_module(void)
 {
index b126638d33b22d57c082fe5c3019083f57a78cac..84a15c34e48449743e8c6efc697fa5cb368ed684 100644 (file)
@@ -1317,4 +1317,40 @@ static int nidio_find_device(struct comedi_device *dev, int bus, int slot)
        return -EIO;
 }
 
-COMEDI_PCI_INITCLEANUP(driver_pcidio, ni_pcidio_pci_table);
+static int __devinit driver_pcidio_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pcidio.driver_name);
+}
+
+static void __devexit driver_pcidio_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pcidio_pci_driver = {
+       .id_table = ni_pcidio_pci_table,
+       .probe = &driver_pcidio_pci_probe,
+       .remove = __devexit_p(&driver_pcidio_pci_remove)
+};
+
+static int __init driver_pcidio_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pcidio);
+       if (retval < 0)
+               return retval;
+
+       driver_pcidio_pci_driver.name = (char *)driver_pcidio.driver_name;
+       return pci_register_driver(&driver_pcidio_pci_driver);
+}
+
+static void __exit driver_pcidio_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pcidio_pci_driver);
+       comedi_driver_unregister(&driver_pcidio);
+}
+
+module_init(driver_pcidio_init_module);
+module_exit(driver_pcidio_cleanup_module);
index 577fda84190d858f7c254f20c5d2faed8d5b375c..23a381247285f020afcfd0477529379541fce054 100644 (file)
@@ -1239,7 +1239,43 @@ static struct comedi_driver driver_pcimio = {
        .detach = pcimio_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_pcimio, ni_pci_table)
+static int __devinit driver_pcimio_pci_probe(struct pci_dev *dev,
+                                            const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pcimio.driver_name);
+}
+
+static void __devexit driver_pcimio_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_pcimio_pci_driver = {
+       .id_table = ni_pci_table,
+       .probe = &driver_pcimio_pci_probe,
+       .remove = __devexit_p(&driver_pcimio_pci_remove)
+};
+
+static int __init driver_pcimio_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_pcimio);
+       if (retval < 0)
+               return retval;
+
+       driver_pcimio_pci_driver.name = (char *)driver_pcimio.driver_name;
+       return pci_register_driver(&driver_pcimio_pci_driver);
+}
+
+static void __exit driver_pcimio_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pcimio_pci_driver);
+       comedi_driver_unregister(&driver_pcimio);
+}
+
+module_init(driver_pcimio_init_module);
+module_exit(driver_pcimio_cleanup_module);
 
 struct ni_private {
 NI_PRIVATE_COMMON};
index 1ca92f949362a2a133dd7deda1c63e5d01240495..0367d2b9e2fac324e6ea5567cd9f24cfad3c43c0 100644 (file)
@@ -2356,7 +2356,43 @@ static int rtd_dio_insn_config(struct comedi_device *dev,
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(rtd520Driver, rtd520_pci_table);
+static int __devinit rtd520Driver_pci_probe(struct pci_dev *dev,
+                                           const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, rtd520Driver.driver_name);
+}
+
+static void __devexit rtd520Driver_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver rtd520Driver_pci_driver = {
+       .id_table = rtd520_pci_table,
+       .probe = &rtd520Driver_pci_probe,
+       .remove = __devexit_p(&rtd520Driver_pci_remove)
+};
+
+static int __init rtd520Driver_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&rtd520Driver);
+       if (retval < 0)
+               return retval;
+
+       rtd520Driver_pci_driver.name = (char *)rtd520Driver.driver_name;
+       return pci_register_driver(&rtd520Driver_pci_driver);
+}
+
+static void __exit rtd520Driver_cleanup_module(void)
+{
+       pci_unregister_driver(&rtd520Driver_pci_driver);
+       comedi_driver_unregister(&rtd520Driver);
+}
+
+module_init(rtd520Driver_init_module);
+module_exit(rtd520Driver_cleanup_module);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index febb62e86ec33226c821c6d9b369b36c1e9428e7..f775ee6171ab2b21f8adcd3904c3ce7a151f7ed3 100644 (file)
@@ -224,7 +224,43 @@ static struct dio_private *dio_private_word[]={
 #define devpriv ((struct s626_private *)dev->private)
 #define diopriv ((struct dio_private *)s->private)
 
-COMEDI_PCI_INITCLEANUP_NOMODULE(driver_s626, s626_pci_table);
+static int __devinit driver_s626_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_s626.driver_name);
+}
+
+static void __devexit driver_s626_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_s626_pci_driver = {
+       .id_table = s626_pci_table,
+       .probe = &driver_s626_pci_probe,
+       .remove = __devexit_p(&driver_s626_pci_remove)
+};
+
+static int __init driver_s626_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_s626);
+       if (retval < 0)
+               return retval;
+
+       driver_s626_pci_driver.name = (char *)driver_s626.driver_name;
+       return pci_register_driver(&driver_s626_pci_driver);
+}
+
+static void __exit driver_s626_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_s626_pci_driver);
+       comedi_driver_unregister(&driver_s626);
+}
+
+module_init(driver_s626_init_module);
+module_exit(driver_s626_cleanup_module);
 
 /* ioctl routines */
 static int s626_ai_insn_config(struct comedi_device *dev,
index d1d5437c59952601c1e9dac4be480ca3a6828b96..732a323ab71036d6680e1b1986981d33ec12de27 100644 (file)
@@ -620,6 +620,45 @@ static int skel_dio_insn_config(struct comedi_device *dev,
        return insn->n;
 }
 
+#ifdef CONFIG_COMEDI_PCI
+static int __devinit driver_skel_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_skel.driver_name);
+}
+
+static void __devexit driver_skel_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_skel_pci_driver = {
+       .id_table = skel_pci_table,
+       .probe = &driver_skel_pci_probe,
+       .remove = __devexit_p(&driver_skel_pci_remove)
+};
+
+static int __init driver_skel_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_skel);
+       if (retval < 0)
+               return retval;
+
+       driver_skel_pci_driver.name = (char *)driver_skel.driver_name;
+       return pci_register_driver(&driver_skel_pci_driver);
+}
+
+static void __exit driver_skel_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_skel_pci_driver);
+       comedi_driver_unregister(&driver_skel);
+}
+
+module_init(driver_skel_init_module);
+module_exit(driver_skel_cleanup_module);
+#else
 static int __init driver_skel_init_module(void)
 {
        return comedi_driver_register(&driver_skel);
@@ -632,10 +671,7 @@ static void __exit driver_skel_cleanup_module(void)
 
 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.
- */
-/* COMEDI_PCI_INITCLEANUP(driver_skel, skel_pci_table) */
+#endif
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");