Staging: ipack/bridges/tpci200: use module_pci_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 18 Oct 2012 15:18:46 +0000 (23:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Oct 2012 18:45:35 +0000 (11:45 -0700)
Use the module_pci_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/ipack/carriers/tpci200.c

index 376e79410e99709718c22c005c305b9a296ea6f3..829fd1ac8f8aea1301b9d4d051c0867859fd247f 100644 (file)
@@ -618,17 +618,7 @@ static struct pci_driver tpci200_pci_drv = {
        .remove = __devexit_p(tpci200_pci_remove),
 };
 
-static int __init tpci200_drvr_init_module(void)
-{
-       return pci_register_driver(&tpci200_pci_drv);
-}
-
-static void __exit tpci200_drvr_exit_module(void)
-{
-       pci_unregister_driver(&tpci200_pci_drv);
-}
+module_pci_driver(tpci200_pci_drv);
 
 MODULE_DESCRIPTION("TEWS TPCI-200 device driver");
 MODULE_LICENSE("GPL");
-module_init(tpci200_drvr_init_module);
-module_exit(tpci200_drvr_exit_module);