Commit c25386f5 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: amplc_pc236: 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_pc236' to 'amplc_pc236_driver' and removed
'driver_' prefix from PCI related functions and variables, purely for
aesthetic reasons.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1bb6dfc4
...@@ -167,7 +167,7 @@ struct pc236_private { ...@@ -167,7 +167,7 @@ struct pc236_private {
*/ */
static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it); static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static void pc236_detach(struct comedi_device *dev); static void pc236_detach(struct comedi_device *dev);
static struct comedi_driver driver_amplc_pc236 = { static struct comedi_driver amplc_pc236_driver = {
.driver_name = PC236_DRIVER_NAME, .driver_name = PC236_DRIVER_NAME,
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pc236_attach, .attach = pc236_attach,
...@@ -178,58 +178,28 @@ static struct comedi_driver driver_amplc_pc236 = { ...@@ -178,58 +178,28 @@ static struct comedi_driver driver_amplc_pc236 = {
}; };
#if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI) #if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI)
static int __devinit driver_amplc_pc236_pci_probe(struct pci_dev *dev, static int __devinit amplc_pc236_pci_probe(struct pci_dev *dev,
const struct pci_device_id const struct pci_device_id
*ent) *ent)
{ {
return comedi_pci_auto_config(dev, &driver_amplc_pc236); return comedi_pci_auto_config(dev, &amplc_pc236_driver);
} }
static void __devexit driver_amplc_pc236_pci_remove(struct pci_dev *dev) static void __devexit amplc_pc236_pci_remove(struct pci_dev *dev)
{ {
comedi_pci_auto_unconfig(dev); comedi_pci_auto_unconfig(dev);
} }
static struct pci_driver driver_amplc_pc236_pci_driver = { static struct pci_driver amplc_pc236_pci_driver = {
.name = PC236_DRIVER_NAME,
.id_table = pc236_pci_table, .id_table = pc236_pci_table,
.probe = &driver_amplc_pc236_pci_probe, .probe = &amplc_pc236_pci_probe,
.remove = __devexit_p(&driver_amplc_pc236_pci_remove) .remove = __devexit_p(&amplc_pc236_pci_remove)
}; };
static int __init driver_amplc_pc236_init_module(void) module_comedi_pci_driver(amplc_pc236_driver, amplc_pc236_pci_driver);
{
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 #else
static int __init driver_amplc_pc236_init_module(void) module_comedi_driver(amplc_pc236_driver);
{
return comedi_driver_register(&driver_amplc_pc236);
}
static void __exit driver_amplc_pc236_cleanup_module(void)
{
comedi_driver_unregister(&driver_amplc_pc236);
}
module_init(driver_amplc_pc236_init_module);
module_exit(driver_amplc_pc236_cleanup_module);
#endif #endif
#if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_ISA) #if IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_ISA)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment