]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: Use module_comedi_pci_driver and standardize drivers
authorH Hartley Sweeten <hartleys@visionengravers.com>
Fri, 11 May 2012 23:16:20 +0000 (16:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2012 20:49:49 +0000 (13:49 -0700)
Convert the refactored comedi pci drivers to use the
module_comedi_pci_driver() macro which makes the code
smaller and a bit simpler.

In the process, rename some of the symbols in the driver
to standardize the comedi pci drivers.

Based on the driver {name}:
1) Rename the comedi_driver to {name}_driver.
2) Use a static string {name} for the comedi_driver.driver_name.
3) Rename the pci probe/remove functions to {name)_pci_probe/remove.
4) Rename the pci id_table to {name}_pci_table.
5) Add the static string {name} for the pci_driver.name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 files changed:
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/adv_pci1723.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/dyna_pci10xx.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/rtd520.c
drivers/staging/comedi/drivers/s626.c

index 889d1476421da68095dea87f1453a33db36ba8d7..f9fefef54050a9bc2fe11b91d943e067b2b3f60c 100644 (file)
@@ -54,8 +54,6 @@ References:
 #include "../comedidev.h"
 #include "comedi_pci.h"
 
-#define PCI6208_DRIVER_NAME    "adl_pci6208"
-
 /* Board descriptions */
 struct pci6208_board {
        const char *name;
@@ -248,7 +246,7 @@ pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr,
        unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
 
        /*  Enable PCI device and request regions */
-       if (comedi_pci_enable(pci_dev, PCI6208_DRIVER_NAME) < 0) {
+       if (comedi_pci_enable(pci_dev, "adl_pci6208") < 0) {
                printk(KERN_ERR "comedi%d: Failed to enable PCI device "
                        "and request regions\n",
                        dev_minor);
@@ -345,59 +343,41 @@ static int pci6208_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_pci6208 = {
-       .driver_name    = PCI6208_DRIVER_NAME,
+static struct comedi_driver adl_pci6208_driver = {
+       .driver_name    = "adl_pci6208",
        .module         = THIS_MODULE,
        .attach         = pci6208_attach,
        .detach         = pci6208_detach,
 };
 
-static int __devinit driver_pci6208_pci_probe(struct pci_dev *dev,
-                                             const struct pci_device_id *ent)
+static int __devinit adl_pci6208_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_pci6208);
+       return comedi_pci_auto_config(dev, &adl_pci6208_driver);
 }
 
-static void __devexit driver_pci6208_pci_remove(struct pci_dev *dev)
+static void __devexit adl_pci6208_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
 /* This is used by modprobe to translate PCI IDs to drivers.  Should
  * only be used for PCI and ISA-PnP devices */
-static DEFINE_PCI_DEVICE_TABLE(pci6208_pci_table) = {
+static DEFINE_PCI_DEVICE_TABLE(adl_pci6208_pci_table) = {
        /* { PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, */
        /* { PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, */
        { PCI_DEVICE(PCI_VENDOR_ID_ADLINK, 0x6208) },
        { 0 }
 };
-MODULE_DEVICE_TABLE(pci, pci6208_pci_table);
+MODULE_DEVICE_TABLE(pci, adl_pci6208_pci_table);
 
-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 struct pci_driver adl_pci6208_pci_driver = {
+       .name           = "adl_pci6208",
+       .id_table       = adl_pci6208_pci_table,
+       .probe          = adl_pci6208_pci_probe,
+       .remove         = __devexit_p(adl_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);
-}
-module_init(driver_pci6208_init_module);
-
-static void __exit driver_pci6208_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_pci6208_pci_driver);
-       comedi_driver_unregister(&driver_pci6208);
-}
-module_exit(driver_pci6208_cleanup_module);
+module_comedi_pci_driver(adl_pci6208_driver, adl_pci6208_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 7bb66b0897bad59ff7a742e007e0826072b8c30a..430ec7374c76b107abbd855c79fe0922355e1bfe 100644 (file)
@@ -163,57 +163,37 @@ static int adl_pci7230_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_adl_pci7230 = {
+static struct comedi_driver adl_pci7230_driver = {
        .driver_name    = "adl_pci7230",
        .module         = THIS_MODULE,
        .attach         = adl_pci7230_attach,
        .detach         = adl_pci7230_detach,
 };
 
-static int __devinit driver_adl_pci7230_pci_probe(struct pci_dev *dev,
-                                                 const struct pci_device_id
-                                                 *ent)
+static int __devinit adl_pci7230_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_adl_pci7230);
+       return comedi_pci_auto_config(dev, &adl_pci7230_driver);
 }
 
-static void __devexit driver_adl_pci7230_pci_remove(struct pci_dev *dev)
+static void __devexit adl_pci7230_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(adl_pci7230_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7230) },
-       {0}
+       { 0 }
 };
 MODULE_DEVICE_TABLE(pci, adl_pci7230_pci_table);
 
-static struct pci_driver driver_adl_pci7230_pci_driver = {
+static struct pci_driver adl_pci7230_pci_driver = {
+       .name           = "adl_pci7230",
        .id_table       = adl_pci7230_pci_table,
-       .probe          = driver_adl_pci7230_pci_probe,
-       .remove         = __devexit_p(driver_adl_pci7230_pci_remove)
+       .probe          = adl_pci7230_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_adl_pci7230_init_module);
-
-static void __exit driver_adl_pci7230_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_adl_pci7230_pci_driver);
-       comedi_driver_unregister(&driver_adl_pci7230);
-}
-module_exit(driver_adl_pci7230_cleanup_module);
+module_comedi_pci_driver(adl_pci7230_driver, adl_pci7230_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 2bd749bac62e5c0d0947726f1f49cee56c4116db..a84a384f9ab934370dd1509604a8774fad30800c 100644 (file)
@@ -155,57 +155,37 @@ static int adl_pci7296_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_adl_pci7296 = {
+static struct comedi_driver adl_pci7296_driver = {
        .driver_name    = "adl_pci7296",
        .module         = THIS_MODULE,
        .attach         = adl_pci7296_attach,
        .detach         = adl_pci7296_detach,
 };
 
-static int __devinit driver_adl_pci7296_pci_probe(struct pci_dev *dev,
-                                                 const struct pci_device_id
-                                                 *ent)
+static int __devinit adl_pci7296_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_adl_pci7296);
+       return comedi_pci_auto_config(dev, &adl_pci7296_driver);
 }
 
-static void __devexit driver_adl_pci7296_pci_remove(struct pci_dev *dev)
+static void __devexit adl_pci7296_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(adl_pci7296_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296) },
-       {0}
+       { 0 }
 };
 MODULE_DEVICE_TABLE(pci, adl_pci7296_pci_table);
 
-static struct pci_driver driver_adl_pci7296_pci_driver = {
+static struct pci_driver adl_pci7296_pci_driver = {
+       .name           = "adl_pci7296",
        .id_table       = adl_pci7296_pci_table,
-       .probe          = driver_adl_pci7296_pci_probe,
-       .remove         = __devexit_p(driver_adl_pci7296_pci_remove)
+       .probe          = adl_pci7296_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_adl_pci7296_init_module);
-
-static void __exit driver_adl_pci7296_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_adl_pci7296_pci_driver);
-       comedi_driver_unregister(&driver_adl_pci7296);
-}
-module_exit(driver_adl_pci7296_cleanup_module);
+module_comedi_pci_driver(adl_pci7296_driver, adl_pci7296_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index db15ec6eb10a5e4c22f75e8ae72bc4faa6473e62..330be9d04b9ee83648ccb7b1218f8d74c22550ab 100644 (file)
@@ -174,57 +174,37 @@ static int adl_pci7432_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_adl_pci7432 = {
+static struct comedi_driver adl_pci7432_driver = {
        .driver_name    = "adl_pci7432",
        .module         = THIS_MODULE,
        .attach         = adl_pci7432_attach,
        .detach         = adl_pci7432_detach,
 };
 
-static int __devinit driver_adl_pci7432_pci_probe(struct pci_dev *dev,
-                                                 const struct pci_device_id
-                                                 *ent)
+static int __devinit adl_pci7432_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_adl_pci7432);
+       return comedi_pci_auto_config(dev, &adl_pci7432_driver);
 }
 
-static void __devexit driver_adl_pci7432_pci_remove(struct pci_dev *dev)
+static void __devexit adl_pci7432_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(adl_pci7432_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7432) },
-       {0}
+       { 0 }
 };
 MODULE_DEVICE_TABLE(pci, adl_pci7432_pci_table);
 
-static struct pci_driver driver_adl_pci7432_pci_driver = {
+static struct pci_driver adl_pci7432_pci_driver = {
+       .name           = "adl_pci7432",
        .id_table       = adl_pci7432_pci_table,
-       .probe          = driver_adl_pci7432_pci_probe,
-       .remove         = __devexit_p(driver_adl_pci7432_pci_remove)
+       .probe          = adl_pci7432_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_adl_pci7432_init_module);
-
-static void __exit driver_adl_pci7432_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_adl_pci7432_pci_driver);
-       comedi_driver_unregister(&driver_adl_pci7432);
-}
-module_exit(driver_adl_pci7432_cleanup_module);
+module_comedi_pci_driver(adl_pci7432_driver, adl_pci7432_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 6b32e45c02282902639767fa94348e7f8a227352..9c5906bb1a15fb3ed79737e576e135be56a65de7 100644 (file)
@@ -327,21 +327,20 @@ static int adl_pci8164_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_adl_pci8164 = {
+static struct comedi_driver adl_pci8164_driver = {
        .driver_name    = "adl_pci8164",
        .module         = THIS_MODULE,
        .attach         = adl_pci8164_attach,
        .detach         = adl_pci8164_detach,
 };
 
-static int __devinit driver_adl_pci8164_pci_probe(struct pci_dev *dev,
-                                                 const struct pci_device_id
-                                                 *ent)
+static int __devinit adl_pci8164_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_adl_pci8164);
+       return comedi_pci_auto_config(dev, &adl_pci8164_driver);
 }
 
-static void __devexit driver_adl_pci8164_pci_remove(struct pci_dev *dev)
+static void __devexit adl_pci8164_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -352,32 +351,13 @@ static DEFINE_PCI_DEVICE_TABLE(adl_pci8164_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, adl_pci8164_pci_table);
 
-static struct pci_driver driver_adl_pci8164_pci_driver = {
+static struct pci_driver adl_pci8164_pci_driver = {
+       .name           = "adl_pci8164",
        .id_table       = adl_pci8164_pci_table,
-       .probe          = driver_adl_pci8164_pci_probe,
-       .remove         = __devexit_p(driver_adl_pci8164_pci_remove),
+       .probe          = adl_pci8164_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_adl_pci8164_init_module);
-
-static void __exit driver_adl_pci8164_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_adl_pci8164_pci_driver);
-       comedi_driver_unregister(&driver_adl_pci8164);
-}
-module_exit(driver_adl_pci8164_cleanup_module);
+module_comedi_pci_driver(adl_pci8164_driver, adl_pci8164_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 4e4e5fdcda371d01dc1fb797885880c75dffc2fc..31dfd865e695a6f4c1146b379a833e824bb3c76d 100644 (file)
@@ -1407,20 +1407,20 @@ static int pci9111_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver pci9111_driver = {
-       .driver_name    = PCI9111_DRIVER_NAME,
+static struct comedi_driver adl_pci9111_driver = {
+       .driver_name    = "adl_pci9111",
        .module         = THIS_MODULE,
        .attach         = pci9111_attach,
        .detach         = pci9111_detach,
 };
 
-static int __devinit pci9111_driver_pci_probe(struct pci_dev *dev,
-                                             const struct pci_device_id *ent)
+static int __devinit pci9111_pci_probe(struct pci_dev *dev,
+                                      const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &pci9111_driver);
+       return comedi_pci_auto_config(dev, &adl_pci9111_driver);
 }
 
-static void __devexit pci9111_driver_pci_remove(struct pci_dev *dev)
+static void __devexit pci9111_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -1432,31 +1432,13 @@ static DEFINE_PCI_DEVICE_TABLE(pci9111_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, pci9111_pci_table);
 
-static struct pci_driver pci9111_driver_pci_driver = {
+static struct pci_driver adl_pci9111_pci_driver = {
+       .name           = "adl_pci9111",
        .id_table       = pci9111_pci_table,
-       .probe          = pci9111_driver_pci_probe,
-       .remove         = __devexit_p(pci9111_driver_pci_remove),
+       .probe          = pci9111_pci_probe,
+       .remove         = __devexit_p(pci9111_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);
-}
-module_init(pci9111_driver_init_module);
-
-static void __exit pci9111_driver_cleanup_module(void)
-{
-       pci_unregister_driver(&pci9111_driver_pci_driver);
-       comedi_driver_unregister(&pci9111_driver);
-}
-module_exit(pci9111_driver_cleanup_module);
+module_comedi_pci_driver(adl_pci9111_driver, adl_pci9111_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 54a33042354b8e2874d1dcd14530b85a3284dd64..6356bd8beac3aaedab4dba76afc8eb818946fa86 100644 (file)
@@ -449,55 +449,37 @@ static int pci1723_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_pci1723 = {
+static struct comedi_driver adv_pci1723_driver = {
        .driver_name    = "adv_pci1723",
        .module         = THIS_MODULE,
        .attach         = pci1723_attach,
        .detach         = pci1723_detach,
 };
 
-static int __devinit driver_pci1723_pci_probe(struct pci_dev *dev,
-                                             const struct pci_device_id *ent)
+static int __devinit adv_pci1723_pci_probe(struct pci_dev *dev,
+                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_pci1723);
+       return comedi_pci_auto_config(dev, &adv_pci1723_driver);
 }
 
-static void __devexit driver_pci1723_pci_remove(struct pci_dev *dev)
+static void __devexit adv_pci1723_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(pci1723_pci_table) = {
+static DEFINE_PCI_DEVICE_TABLE(adv_pci1723_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_ADVANTECH, 0x1723) },
        { 0 }
 };
-MODULE_DEVICE_TABLE(pci, pci1723_pci_table);
+MODULE_DEVICE_TABLE(pci, adv_pci1723_pci_table);
 
-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 struct pci_driver adv_pci1723_pci_driver = {
+       .name           = "adv_pci1723",
+       .id_table       = adv_pci1723_pci_table,
+       .probe          = adv_pci1723_pci_probe,
+       .remove         = __devexit_p(adv_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);
-}
-module_init(driver_pci1723_init_module);
-
-static void __exit driver_pci1723_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_pci1723_pci_driver);
-       comedi_driver_unregister(&driver_pci1723);
-}
-module_exit(driver_pci1723_cleanup_module);
+module_comedi_pci_driver(adv_pci1723_driver, adv_pci1723_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 932eac97ff7eefed6e9bc799e52d331710627526..6d113cdee9649153deb613c11f79f740ee0b70e8 100644 (file)
@@ -962,25 +962,25 @@ static int dt3000_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_dt3000 = {
+static struct comedi_driver dt3000_driver = {
        .driver_name    = "dt3000",
        .module         = THIS_MODULE,
        .attach         = dt3000_attach,
        .detach         = dt3000_detach,
 };
 
-static int __devinit driver_dt3000_pci_probe(struct pci_dev *dev,
-                                            const struct pci_device_id *ent)
+static int __devinit dt3000_pci_probe(struct pci_dev *dev,
+                                     const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_dt3000);
+       return comedi_pci_auto_config(dev, &dt3000_driver);
 }
 
-static void __devexit driver_dt3000_pci_remove(struct pci_dev *dev)
+static void __devexit dt3000_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(dt3k_pci_table) = {
+static DEFINE_PCI_DEVICE_TABLE(dt3000_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_DT, 0x0022) },
        { PCI_DEVICE(PCI_VENDOR_ID_DT, 0x0027) },
        { PCI_DEVICE(PCI_VENDOR_ID_DT, 0x0023) },
@@ -990,33 +990,15 @@ static DEFINE_PCI_DEVICE_TABLE(dt3k_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_DT, 0x0026) },
        { 0 }
 };
-MODULE_DEVICE_TABLE(pci, dt3k_pci_table);
+MODULE_DEVICE_TABLE(pci, dt3000_pci_table);
 
-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 struct pci_driver dt3000_pci_driver = {
+       .name           = "dt3000",
+       .id_table       = dt3000_pci_table,
+       .probe          = dt3000_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_dt3000_init_module);
-
-static void __exit driver_dt3000_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_dt3000_pci_driver);
-       comedi_driver_unregister(&driver_dt3000);
-}
-module_exit(driver_dt3000_cleanup_module);
+module_comedi_pci_driver(dt3000_driver, dt3000_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index bb86c8502ce52ddb83424d9d2ff2ad86db83dc82..23375deb3f300026c5076dcad545ccf3d8f70874 100644 (file)
@@ -397,8 +397,8 @@ static int dyna_pci10xx_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_dyna_pci10xx = {
-       .driver_name    = DRV_NAME,
+static struct comedi_driver dyna_pci10xx_driver = {
+       .driver_name    = "dyna_pci10xx",
        .module         = THIS_MODULE,
        .attach         = dyna_pci10xx_attach,
        .detach         = dyna_pci10xx_detach,
@@ -407,13 +407,13 @@ static struct comedi_driver driver_dyna_pci10xx = {
        .num_names      = ARRAY_SIZE(boardtypes),
 };
 
-static int __devinit driver_dyna_pci10xx_pci_probe(struct pci_dev *dev,
-                                             const struct pci_device_id *ent)
+static int __devinit dyna_pci10xx_pci_probe(struct pci_dev *dev,
+                                           const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_dyna_pci10xx);
+       return comedi_pci_auto_config(dev, &dyna_pci10xx_driver);
 }
 
-static void __devexit driver_dyna_pci10xx_pci_remove(struct pci_dev *dev)
+static void __devexit dyna_pci10xx_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -424,32 +424,13 @@ static DEFINE_PCI_DEVICE_TABLE(dyna_pci10xx_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, dyna_pci10xx_pci_table);
 
-static struct pci_driver driver_dyna_pci10xx_pci_driver = {
+static struct pci_driver dyna_pci10xx_pci_driver = {
+       .name           = "dyna_pci10xx",
        .id_table       = dyna_pci10xx_pci_table,
-       .probe          = driver_dyna_pci10xx_pci_probe,
-       .remove         = __devexit_p(driver_dyna_pci10xx_pci_remove),
+       .probe          = dyna_pci10xx_pci_probe,
+       .remove         = __devexit_p(dyna_pci10xx_pci_remove),
 };
-
-static int __init driver_dyna_pci10xx_init_module(void)
-{
-       int retval;
-
-       retval = comedi_driver_register(&driver_dyna_pci10xx);
-       if (retval < 0)
-               return retval;
-
-       driver_dyna_pci10xx_pci_driver.name =
-               (char *)driver_dyna_pci10xx.driver_name;
-       return pci_register_driver(&driver_dyna_pci10xx_pci_driver);
-}
-module_init(driver_dyna_pci10xx_init_module);
-
-static void __exit driver_dyna_pci10xx_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_dyna_pci10xx_pci_driver);
-       comedi_driver_unregister(&driver_dyna_pci10xx);
-}
-module_exit(driver_dyna_pci10xx_cleanup_module);
+module_comedi_pci_driver(dyna_pci10xx_driver, dyna_pci10xx_pci_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Prashant Shah <pshah.mumbai@gmail.com>");
index 9e21de0134eef4c8f151dae4b24259d9058dc535..beb82d97d836c0d4908a12f9705079d19a708445 100644 (file)
@@ -950,20 +950,20 @@ static int jr3_pci_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_jr3_pci = {
+static struct comedi_driver jr3_pci_driver = {
        .driver_name    = "jr3_pci",
        .module         = THIS_MODULE,
        .attach         = jr3_pci_attach,
        .detach         = jr3_pci_detach,
 };
 
-static int __devinit driver_jr3_pci_pci_probe(struct pci_dev *dev,
-                                             const struct pci_device_id *ent)
+static int __devinit jr3_pci_pci_probe(struct pci_dev *dev,
+                                      const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_jr3_pci);
+       return comedi_pci_auto_config(dev, &jr3_pci_driver);
 }
 
-static void __devexit driver_jr3_pci_pci_remove(struct pci_dev *dev)
+static void __devexit jr3_pci_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -978,31 +978,13 @@ static DEFINE_PCI_DEVICE_TABLE(jr3_pci_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, jr3_pci_pci_table);
 
-static struct pci_driver driver_jr3_pci_pci_driver = {
+static struct pci_driver jr3_pci_pci_driver = {
+       .name           = "jr3_pci",
        .id_table       = jr3_pci_pci_table,
-       .probe          = driver_jr3_pci_pci_probe,
-       .remove         = __devexit_p(driver_jr3_pci_pci_remove),
+       .probe          = jr3_pci_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_jr3_pci_init_module);
-
-static void __exit driver_jr3_pci_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_jr3_pci_pci_driver);
-       comedi_driver_unregister(&driver_jr3_pci);
-}
-module_exit(driver_jr3_pci_cleanup_module);
+module_comedi_pci_driver(jr3_pci_driver, jr3_pci_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 0db76a502924c1e15acb136c50c06c41623dd4a9..708704dbe436485005fbb93852020b31141e9cbe 100644 (file)
@@ -231,55 +231,37 @@ static int cnt_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver cnt_driver = {
-       .driver_name    = CNT_DRIVER_NAME,
+static struct comedi_driver ke_counter_driver = {
+       .driver_name    = "ke_counter",
        .module         = THIS_MODULE,
        .attach         = cnt_attach,
        .detach         = cnt_detach,
 };
 
-static int __devinit cnt_driver_pci_probe(struct pci_dev *dev,
+static int __devinit ke_counter_pci_probe(struct pci_dev *dev,
                                          const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &cnt_driver);
+       return comedi_pci_auto_config(dev, &ke_counter_driver);
 }
 
-static void __devexit cnt_driver_pci_remove(struct pci_dev *dev)
+static void __devexit ke_counter_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(cnt_pci_table) = {
+static DEFINE_PCI_DEVICE_TABLE(ke_counter_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_KOLTER, CNT_CARD_DEVICE_ID) },
        { 0 }
 };
-MODULE_DEVICE_TABLE(pci, cnt_pci_table);
+MODULE_DEVICE_TABLE(pci, ke_counter_pci_table);
 
-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 struct pci_driver ke_counter_pci_driver = {
+       .name           = "ke_counter",
+       .id_table       = ke_counter_pci_table,
+       .probe          = ke_counter_pci_probe,
+       .remove         = __devexit_p(ke_counter_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);
-}
-module_init(cnt_driver_init_module);
-
-static void __exit cnt_driver_cleanup_module(void)
-{
-       pci_unregister_driver(&cnt_driver_pci_driver);
-       comedi_driver_unregister(&cnt_driver);
-}
-module_exit(cnt_driver_cleanup_module);
+module_comedi_pci_driver(ke_counter_driver, ke_counter_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index c54c071166c453e50e786ccd013f6c693ce34ce0..879acbcca16c80d675016504eb6853b0e97502dd 100644 (file)
@@ -2320,20 +2320,20 @@ static int me4000_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_me4000 = {
+static struct comedi_driver me4000_driver = {
        .driver_name    = "me4000",
        .module         = THIS_MODULE,
        .attach         = me4000_attach,
        .detach         = me4000_detach,
 };
 
-static int __devinit driver_me4000_pci_probe(struct pci_dev *dev,
-                                            const struct pci_device_id *ent)
+static int __devinit me4000_pci_probe(struct pci_dev *dev,
+                                     const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_me4000);
+       return comedi_pci_auto_config(dev, &me4000_driver);
 }
 
-static void __devexit driver_me4000_pci_remove(struct pci_dev *dev)
+static void __devexit me4000_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -2356,31 +2356,13 @@ static DEFINE_PCI_DEVICE_TABLE(me4000_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, me4000_pci_table);
 
-static struct pci_driver driver_me4000_pci_driver = {
+static struct pci_driver me4000_pci_driver = {
+       .name           = "me4000",
        .id_table       = me4000_pci_table,
-       .probe          = driver_me4000_pci_probe,
-       .remove         = __devexit_p(driver_me4000_pci_remove),
+       .probe          = me4000_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_me4000_init_module);
-
-static void __exit driver_me4000_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_me4000_pci_driver);
-       comedi_driver_unregister(&driver_me4000);
-}
-module_exit(driver_me4000_cleanup_module);
+module_comedi_pci_driver(me4000_driver, me4000_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 4ce6339a2a2c6a4c72ff87852f20a66494220b84..1f99527a7fa9eeebdd2ba827d69d18a59bc078f9 100644 (file)
@@ -825,56 +825,38 @@ static int me_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver me_driver = {
-       .driver_name    = ME_DRIVER_NAME,
+static struct comedi_driver me_daq_driver = {
+       .driver_name    = "me_daq",
        .module         = THIS_MODULE,
        .attach         = me_attach,
        .detach         = me_detach,
 };
 
-static int __devinit me_driver_pci_probe(struct pci_dev *dev,
-                                        const struct pci_device_id *ent)
+static int __devinit me_daq_pci_probe(struct pci_dev *dev,
+                                     const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &me_driver);
+       return comedi_pci_auto_config(dev, &me_daq_driver);
 }
 
-static void __devexit me_driver_pci_remove(struct pci_dev *dev)
+static void __devexit me_daq_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(me_pci_table) = {
+static DEFINE_PCI_DEVICE_TABLE(me_daq_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_MEILHAUS, ME2600_DEVICE_ID) },
        { PCI_DEVICE(PCI_VENDOR_ID_MEILHAUS, ME2000_DEVICE_ID) },
        { 0 }
 };
-MODULE_DEVICE_TABLE(pci, me_pci_table);
+MODULE_DEVICE_TABLE(pci, me_daq_pci_table);
 
-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 struct pci_driver me_daq_pci_driver = {
+       .name           = "me_daq",
+       .id_table       = me_daq_pci_table,
+       .probe          = me_daq_pci_probe,
+       .remove         = __devexit_p(me_daq_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);
-}
-module_init(me_driver_init_module);
-
-static void __exit me_driver_cleanup_module(void)
-{
-       pci_unregister_driver(&me_driver_pci_driver);
-       comedi_driver_unregister(&me_driver);
-}
-module_exit(me_driver_cleanup_module);
+module_comedi_pci_driver(me_daq_driver, me_daq_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 0e62bae0f5b7eaf4da9c1b04482df3a6594bf012..32766edcde37794d28cd85829514097359cbc783 100644 (file)
@@ -2346,20 +2346,20 @@ static int rtd_dio_insn_config(struct comedi_device *dev,
        return 1;
 }
 
-static struct comedi_driver rtd520Driver = {
-       .driver_name    = DRV_NAME,
+static struct comedi_driver rtd520_driver = {
+       .driver_name    = "rtd520",
        .module         = THIS_MODULE,
        .attach         = rtd_attach,
        .detach         = rtd_detach,
 };
 
-static int __devinit rtd520Driver_pci_probe(struct pci_dev *dev,
-                                           const struct pci_device_id *ent)
+static int __devinit rtd520_pci_probe(struct pci_dev *dev,
+                                     const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &rtd520Driver);
+       return comedi_pci_auto_config(dev, &rtd520_driver);
 }
 
-static void __devexit rtd520Driver_pci_remove(struct pci_dev *dev)
+static void __devexit rtd520_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -2371,31 +2371,13 @@ static DEFINE_PCI_DEVICE_TABLE(rtd520_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, rtd520_pci_table);
 
-static struct pci_driver rtd520Driver_pci_driver = {
+static struct pci_driver rtd520_pci_driver = {
+       .name           = "rtd520",
        .id_table       = rtd520_pci_table,
-       .probe          = &rtd520Driver_pci_probe,
-       .remove         = __devexit_p(&rtd520Driver_pci_remove)
+       .probe          = rtd520_pci_probe,
+       .remove         = __devexit_p(rtd520_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);
-}
-module_init(rtd520Driver_init_module);
-
-static void __exit rtd520Driver_cleanup_module(void)
-{
-       pci_unregister_driver(&rtd520Driver_pci_driver);
-       comedi_driver_unregister(&rtd520Driver);
-}
-module_exit(rtd520Driver_cleanup_module);
+module_comedi_pci_driver(rtd520_driver, rtd520_pci_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index ad4d2f66677f70d129c1c11500e5e7bfb61c9f64..56b111f3ecccb350b2405d93b8334dc7e5c3ffcf 100644 (file)
@@ -3315,20 +3315,20 @@ static void CountersInit(struct comedi_device *dev)
 
 }
 
-static struct comedi_driver driver_s626 = {
+static struct comedi_driver s626_driver = {
        .driver_name    = "s626",
        .module         = THIS_MODULE,
        .attach         = s626_attach,
        .detach         = s626_detach,
 };
 
-static int __devinit driver_s626_pci_probe(struct pci_dev *dev,
-                                          const struct pci_device_id *ent)
+static int __devinit s626_pci_probe(struct pci_dev *dev,
+                                   const struct pci_device_id *ent)
 {
-       return comedi_pci_auto_config(dev, &driver_s626);
+       return comedi_pci_auto_config(dev, &s626_driver);
 }
 
-static void __devexit driver_s626_pci_remove(struct pci_dev *dev)
+static void __devexit s626_pci_remove(struct pci_dev *dev)
 {
        comedi_pci_auto_unconfig(dev);
 }
@@ -3345,31 +3345,13 @@ static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = {
 };
 MODULE_DEVICE_TABLE(pci, s626_pci_table);
 
-static struct pci_driver driver_s626_pci_driver = {
+static struct pci_driver s626_pci_driver = {
+       .name           = "s626",
        .id_table       = s626_pci_table,
-       .probe          = driver_s626_pci_probe,
-       .remove         = __devexit_p(driver_s626_pci_remove),
+       .probe          = s626_pci_probe,
+       .remove         = __devexit_p(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);
-}
-module_init(driver_s626_init_module);
-
-static void __exit driver_s626_cleanup_module(void)
-{
-       pci_unregister_driver(&driver_s626_pci_driver);
-       comedi_driver_unregister(&driver_s626);
-}
-module_exit(driver_s626_cleanup_module);
+module_comedi_pci_driver(s626_driver, s626_pci_driver);
 
 MODULE_AUTHOR("Gianluca Palli <gpalli@deis.unibo.it>");
 MODULE_DESCRIPTION("Sensoray 626 Comedi driver module");