net/ethernet/chelsio/cxgb/cxgb2: Use module_pci_driver to register driver
authorPeter Hüwe <PeterHuewe@gmx.de>
Tue, 21 May 2013 13:42:55 +0000 (13:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 May 2013 21:35:05 +0000 (14:35 -0700)
Removing some boilerplate by using module_pci_driver instead of calling
register and unregister in the otherwise empty init/exit functions.

The name of the pci_driver struct had to be changed in order to prevent
a build failure.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb/cxgb2.c

index 9624cfe7df57154a7377f34253e3d42801762d23..d7048db9863d905a57b23b9bc985a4c3d27f9bc9 100644 (file)
@@ -1351,22 +1351,11 @@ static void remove_one(struct pci_dev *pdev)
        t1_sw_reset(pdev);
 }
 
-static struct pci_driver driver = {
+static struct pci_driver cxgb_pci_driver = {
        .name     = DRV_NAME,
        .id_table = t1_pci_tbl,
        .probe    = init_one,
        .remove   = remove_one,
 };
 
-static int __init t1_init_module(void)
-{
-       return pci_register_driver(&driver);
-}
-
-static void __exit t1_cleanup_module(void)
-{
-       pci_unregister_driver(&driver);
-}
-
-module_init(t1_init_module);
-module_exit(t1_cleanup_module);
+module_pci_driver(cxgb_pci_driver);