summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-09-14 17:34:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-17 05:09:04 -0700
commitb4c9a598a7d858bbb845b9b4067c065f63abc10a (patch)
treef26fd30b1c7534405b5739c2907ecb34f6ce3535 /drivers/staging/comedi
parenta8adadee9427e23fe7513fc214fe29f7307e7aa1 (diff)
staging: comedi: ni_660x: use module_comedi_pci_driver()
Use the macro `module_comedi_pci_driver(comedi_driver, pci_driver)` to register the module as a Comedi PCI driver. Rename variables and functions that have prefix `driver_` for consistency. Set the `name` member of the `struct pci_driver` variable in its initializer instead of initializing it in the module initialization function. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/ni_660x.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c
index 43254cc79482..54738c9529d6 100644
--- a/drivers/staging/comedi/drivers/ni_660x.c
+++ b/drivers/staging/comedi/drivers/ni_660x.c
@@ -464,50 +464,31 @@ static void ni_660x_select_pfi_output(struct comedi_device *dev,
unsigned pfi_channel,
unsigned output_select);
-static struct comedi_driver driver_ni_660x = {
+static struct comedi_driver ni_660x_driver = {
.driver_name = "ni_660x",
.module = THIS_MODULE,
.attach = ni_660x_attach,
.detach = ni_660x_detach,
};
-static int __devinit driver_ni_660x_pci_probe(struct pci_dev *dev,
- const struct pci_device_id *ent)
+static int __devinit ni_660x_pci_probe(struct pci_dev *dev,
+ const struct pci_device_id *ent)
{
- return comedi_pci_auto_config(dev, &driver_ni_660x);
+ return comedi_pci_auto_config(dev, &ni_660x_driver);
}
-static void __devexit driver_ni_660x_pci_remove(struct pci_dev *dev)
+static void __devexit ni_660x_pci_remove(struct pci_dev *dev)
{
comedi_pci_auto_unconfig(dev);
}
-static struct pci_driver driver_ni_660x_pci_driver = {
+static struct pci_driver ni_660x_pci_driver = {
+ .name = "ni_660x",
.id_table = ni_660x_pci_table,
- .probe = &driver_ni_660x_pci_probe,
- .remove = __devexit_p(&driver_ni_660x_pci_remove)
+ .probe = ni_660x_pci_probe,
+ .remove = __devexit_p(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);
+module_comedi_pci_driver(ni_660x_driver, ni_660x_pci_driver);
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,