Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro
[deliverable/linux.git] / drivers / staging / comedi / drivers / amplc_pc263.c
index 15808e95ceabc0714dd5e0576950950e4170d23c..8a3388079094a6b4f9e5e5ae090ad7cca7810e86 100644 (file)
@@ -432,7 +432,60 @@ static int pc263_dio_insn_config(struct comedi_device *dev,
  * as necessary.
  */
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_amplc_pc263, pc263_pci_table);
+static int __devinit driver_amplc_pc263_pci_probe(struct pci_dev *dev,
+                                                 const struct pci_device_id
+                                                 *ent)
+{
+       return comedi_pci_auto_config(dev, driver_amplc_pc263.driver_name);
+}
+
+static void __devexit driver_amplc_pc263_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_amplc_pc263_pci_driver = {
+       .id_table = pc263_pci_table,
+       .probe = &driver_amplc_pc263_pci_probe,
+       .remove = __devexit_p(&driver_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);
 #else
-COMEDI_INITCLEANUP(driver_amplc_pc263);
+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);
 #endif
+
+MODULE_AUTHOR("Comedi http://www.comedi.org");
+MODULE_DESCRIPTION("Comedi low-level driver");
+MODULE_LICENSE("GPL");
This page took 0.038733 seconds and 5 git commands to generate.