net: atheros: atl2: use module_pci_driver to simplify the code
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 7 Apr 2021 15:07:11 +0000 (15:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Apr 2021 22:15:01 +0000 (15:15 -0700)
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/atheros/atlx/atl2.c

index f016f2e12ee776f3f39ba28b6899a123e5f6f7dd..0cc0db04c27d11b7f9283db758556e532d6017ef 100644 (file)
@@ -1675,29 +1675,7 @@ static struct pci_driver atl2_driver = {
        .shutdown = atl2_shutdown,
 };
 
-/**
- * atl2_init_module - Driver Registration Routine
- *
- * atl2_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- */
-static int __init atl2_init_module(void)
-{
-       return pci_register_driver(&atl2_driver);
-}
-module_init(atl2_init_module);
-
-/**
- * atl2_exit_module - Driver Exit Cleanup Routine
- *
- * atl2_exit_module is called just before the driver is removed
- * from memory.
- */
-static void __exit atl2_exit_module(void)
-{
-       pci_unregister_driver(&atl2_driver);
-}
-module_exit(atl2_exit_module);
+module_pci_driver(atl2_driver);
 
 static void atl2_read_pci_cfg(struct atl2_hw *hw, u32 reg, u16 *value)
 {