net: cavium: use module_pci_driver to simplify the code
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 28 Mar 2018 12:51:55 +0000 (12:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 18:36:33 +0000 (14:36 -0400)
Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/common/cavium_ptp.c

index d59497a..6aeb104 100644 (file)
@@ -336,18 +336,7 @@ static struct pci_driver cavium_ptp_driver = {
        .remove = cavium_ptp_remove,
 };
 
-static int __init cavium_ptp_init_module(void)
-{
-       return pci_register_driver(&cavium_ptp_driver);
-}
-
-static void __exit cavium_ptp_cleanup_module(void)
-{
-       pci_unregister_driver(&cavium_ptp_driver);
-}
-
-module_init(cavium_ptp_init_module);
-module_exit(cavium_ptp_cleanup_module);
+module_pci_driver(cavium_ptp_driver);
 
 MODULE_DESCRIPTION(DRV_NAME);
 MODULE_AUTHOR("Cavium Networks <support@cavium.com>");