[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369179778-20115-18-git-send-email-peterhuewe@gmx.de>
Date: Wed, 22 May 2013 01:42:55 +0200
From: Peter Huewe <peterhuewe@....de>
To: "David S. Miller" <davem@...emloft.net>
Cc: Peter Huewe <peterhuewe@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bill Pemberton <wfp5p@...ginia.edu>,
Patrick McHardy <kaber@...sh.net>,
netdev@...r.kernel.org (open list:NETWORKING DRIVERS),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 18/19] net/ethernet/chelsio/cxgb/cxgb2: Use module_pci_driver to register driver
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@....de>
---
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
index 9624cfe..d7048db 100644
--- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
+++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
@@ -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);
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists