diff options
author | Arun Thomas <arun.thomas@gmail.com> | 2010-06-06 22:23:31 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-17 13:48:12 -0700 |
commit | 727b286b44ea359d66f47d241cc2cdad36ed7bdc (patch) | |
tree | 38d575ee35bc4d3eb5afb6fd6d8f5ec3a0545826 /drivers/staging/comedi/drivers/amplc_pci224.c | |
parent | 7114a28011f9d5f3d981731ad341177c21f9d948 (diff) | |
download | op-kernel-dev-727b286b44ea359d66f47d241cc2cdad36ed7bdc.zip op-kernel-dev-727b286b44ea359d66f47d241cc2cdad36ed7bdc.tar.gz |
Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_pci224.c')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pci224.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index a27e27f..1b5ba1c 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c @@ -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. |