]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/comedi/drivers/ni_660x.c
Merge branch 'for-linus' of git://neil.brown.name/md
[mv-sheeva.git] / drivers / staging / comedi / drivers / ni_660x.c
index 6a6fae53ea0b39fcc8d693b2246bddb431258b6b..ca2aeaa9449cfaac27348a9442a02031b2bb2242 100644 (file)
@@ -382,7 +382,7 @@ enum global_interrupt_config_register_bits {
        Global_Int_Enable_Bit = 0x80000000
 };
 
-/* Offset of the GPCT chips from the base-adress of the card */
+/* Offset of the GPCT chips from the base-address of the card */
 /* First chip is at base-address + 0x00, etc. */
 static const unsigned GPCT_OFFSET[2] = { 0x0, 0x800 };
 
@@ -471,7 +471,43 @@ static struct comedi_driver driver_ni_660x = {
        .detach = ni_660x_detach,
 };
 
-COMEDI_PCI_INITCLEANUP(driver_ni_660x, ni_660x_pci_table);
+static int __devinit driver_ni_660x_pci_probe(struct pci_dev *dev,
+                                             const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_ni_660x.driver_name);
+}
+
+static void __devexit driver_ni_660x_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_ni_660x_pci_driver = {
+       .id_table = ni_660x_pci_table,
+       .probe = &driver_ni_660x_pci_probe,
+       .remove = __devexit_p(&driver_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);
 
 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,
@@ -1385,3 +1421,7 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev,
        };
        return 0;
 }
+
+MODULE_AUTHOR("Comedi http://www.comedi.org");
+MODULE_DESCRIPTION("Comedi low-level driver");
+MODULE_LICENSE("GPL");