From b61b2b1f588ba8b0a5eef64a78687fe5cc80d337 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 1 Nov 2012 14:02:16 +0000 Subject: [PATCH] staging: comedi: skel: use module_comedi_pci_driver() 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/skel.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/skel.c b/drivers/staging/comedi/drivers/skel.c index 67285359b916..d628339261c7 100644 --- a/drivers/staging/comedi/drivers/skel.c +++ b/drivers/staging/comedi/drivers/skel.c @@ -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 -- 2.39.5