staging: comedi: skel: use module_comedi_pci_driver()
authorIan Abbott <abbotti@mev.co.uk>
Thu, 1 Nov 2012 14:02:16 +0000 (14:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Nov 2012 15:46:02 +0000 (08:46 -0700)
Use the `module_comedi_pci_driver()` macro to register the module as a
comedi PCI driver instead of adding the boiler-plate code in full.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/skel.c

index 67285359b9165e3e0437e30b204163a4058149fa..d628339261c747e8a1f33cf4679f06da50bbd22d 100644 (file)
@@ -598,27 +598,7 @@ static struct pci_driver skel_pci_driver = {
        .probe = &skel_pci_probe,
        .remove = __devexit_p(&skel_pci_remove)
 };
-
-static int __init skel_init_module(void)
-{
-       int retval;
-
-       retval = comedi_driver_register(&skel_driver);
-       if (retval < 0)
-               return retval;
-
-       skel_pci_driver.name = (char *)skel_driver.driver_name;
-       return pci_register_driver(&skel_pci_driver);
-}
-
-static void __exit skel_cleanup_module(void)
-{
-       pci_unregister_driver(&skel_pci_driver);
-       comedi_driver_unregister(&skel_driver);
-}
-
-module_init(skel_init_module);
-module_exit(skel_cleanup_module);
+module_comedi_pci_driver(skel_driver, skel_pci_driver);
 #else
 module_comedi_driver(skel_driver);
 #endif