summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_pc263.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-05-30 19:04:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-04 20:48:07 -0700
commit40372f5f66c4d123b8bd17b785fadecd19eb2bd1 (patch)
tree6e050818a9a2a3a10d1d27eb1a100bf39885b7c0 /drivers/staging/comedi/drivers/amplc_pc263.c
parentb4843c19be4cbae48dc002080bdf49c274f26796 (diff)
staging: comedi: amplc_pc263: Use module_comedi_{pci, }_driver()
If PCI boards are supported, use the module_comedi_pci_driver() macro to register the module as a comedi driver and a PCI driver. Otherwise, only ISA boards are supported so use the module_comedi_driver() macro to register the module as a comedi driver. Renamed 'driver_amplc_pc263' to 'amplc_pc263_driver' and removed 'driver_' prefix from PCI related functions and variables, purely for aesthetic reasons. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_pc263.c')
-rw-r--r--drivers/staging/comedi/drivers/amplc_pc263.c55
1 files changed, 10 insertions, 45 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c
index f33eb0d43274..f3cab3547bde 100644
--- a/drivers/staging/comedi/drivers/amplc_pc263.c
+++ b/drivers/staging/comedi/drivers/amplc_pc263.c
@@ -130,7 +130,7 @@ struct pc263_private {
*/
static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static void pc263_detach(struct comedi_device *dev);
-static struct comedi_driver driver_amplc_pc263 = {
+static struct comedi_driver amplc_pc263_driver = {
.driver_name = PC263_DRIVER_NAME,
.module = THIS_MODULE,
.attach = pc263_attach,
@@ -349,63 +349,28 @@ static int pc263_do_insn_bits(struct comedi_device *dev,
return 2;
}
-/*
- * A convenient macro that defines init_module() and cleanup_module(),
- * as necessary.
- */
#if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC263_PCI)
-static int __devinit driver_amplc_pc263_pci_probe(struct pci_dev *dev,
+static int __devinit amplc_pc263_pci_probe(struct pci_dev *dev,
const struct pci_device_id
*ent)
{
- return comedi_pci_auto_config(dev, &driver_amplc_pc263);
+ return comedi_pci_auto_config(dev, &amplc_pc263_driver);
}
-static void __devexit driver_amplc_pc263_pci_remove(struct pci_dev *dev)
+static void __devexit amplc_pc263_pci_remove(struct pci_dev *dev)
{
comedi_pci_auto_unconfig(dev);
}
-static struct pci_driver driver_amplc_pc263_pci_driver = {
+static struct pci_driver amplc_pc263_pci_driver = {
+ .name = PC263_DRIVER_NAME,
.id_table = pc263_pci_table,
- .probe = &driver_amplc_pc263_pci_probe,
- .remove = __devexit_p(&driver_amplc_pc263_pci_remove)
+ .probe = &amplc_pc263_pci_probe,
+ .remove = __devexit_p(&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);
+module_comedi_pci_driver(amplc_pc263_driver, amplc_pc263_pci_driver);
#else
-static int __init driver_amplc_pc263_init_module(void)
-{
- return comedi_driver_register(&driver_amplc_pc263);
-}
-
-static void __exit driver_amplc_pc263_cleanup_module(void)
-{
- comedi_driver_unregister(&driver_amplc_pc263);
-}
-
-module_init(driver_amplc_pc263_init_module);
-module_exit(driver_amplc_pc263_cleanup_module);
+module_comedi_driver(amplc_pc263_driver);
#endif
MODULE_AUTHOR("Comedi http://www.comedi.org");