Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro
[deliverable/linux.git] / drivers / staging / comedi / drivers / adv_pci1723.c
index 9fe8fcc7f1d602e0018a10750df8559a8c4fdc6e..b133bb84c4fe4255bf8b93059674a169399c985d 100644 (file)
@@ -496,4 +496,44 @@ static int pci1723_detach(struct comedi_device *dev)
  * A convenient macro that defines init_module() and cleanup_module(),
  * as necessary.
  */
-COMEDI_PCI_INITCLEANUP(driver_pci1723, pci1723_pci_table);
+static int __devinit driver_pci1723_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_pci1723.driver_name);
+}
+
+static void __devexit driver_pci1723_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+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 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);
+}
+
+static void __exit driver_pci1723_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_pci1723_pci_driver);
+       comedi_driver_unregister(&driver_pci1723);
+}
+
+module_init(driver_pci1723_init_module);
+module_exit(driver_pci1723_cleanup_module);
+
+MODULE_AUTHOR("Comedi http://www.comedi.org");
+MODULE_DESCRIPTION("Comedi low-level driver");
+MODULE_LICENSE("GPL");
This page took 0.024844 seconds and 5 git commands to generate.