staging: comedi: skel: use module_comedi_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 26 Oct 2012 15:24:46 +0000 (23:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Oct 2012 16:14:53 +0000 (09:14 -0700)
Use the module_comedi_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/skel.c

index f292d798f31ae7b189dbe0d355fab308c644be45..e1b78a11196055baa98744fc0fa6109c6d6e04c2 100644 (file)
@@ -628,18 +628,7 @@ static void __exit driver_skel_cleanup_module(void)
 module_init(driver_skel_init_module);
 module_exit(driver_skel_cleanup_module);
 #else
-static int __init driver_skel_init_module(void)
-{
-       return comedi_driver_register(&driver_skel);
-}
-
-static void __exit driver_skel_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_skel);
-}
-
-module_init(driver_skel_init_module);
-module_exit(driver_skel_cleanup_module);
+module_comedi_driver(driver_skel);
 #endif
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");