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 8e01065..68aa917 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 b18e81d..5ed4b94 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 3816115..0bc6ac2 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 46b5c5c..caeb4e1 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 e7c5d66..947fae5 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 d68fbe2..3b2f8e3 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 5fafaf0..1b7155e 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 429a551..38a5752 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 d6c17e2..b0e39cb 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 dbb50cf..2791f90 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 b973249..b133bb8 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 e7ba1f0..d81bbfa 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 674cf1d..93bbe4e 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 5ffee05..48246cd 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 83af437..8a33880 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 a27e27f..1b5ba1c 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 53d3414..b572df7 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 04c7170..2d9ad53 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 168a335..ba7c48a 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 3c2a84e..349c7a6 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 3afba5f..a9d902f 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 bb5553d..e50b8c2 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 f404ec7..3160330 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 a3d55f4..24ac10c 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 83cde27..6af6c83 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 c3f1fed..7e7b1a7 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 79ea24d..656e7bb 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 a24d099..1661b57 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 35a7892..788a01b 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 35d9869..e30aa01 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 58df326..29e0481 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 d03c0f7..579e6a5 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 1fc76cc..14e716e 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 d793f5a..8b8e2aa 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 6a6fae5..523cb29 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 44ae836..e9f034e 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 383ee10..170bab6 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 b126638..84a15c3 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 577fda8..23a3812 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 1ca92f9..0367d2b 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 febb62e..f775ee6 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 d1d5437..732a323 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");