From: Peter Huewe <peterhuewe@gmx.de>
To: "David S. Miller" <davem@davemloft.net>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jay Cliburn <jcliburn@gmail.com>,
Chris Snook <chris.snook@gmail.com>,
Fabio Estevam <fabio.estevam@freescale.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Joe Perches <joe@perches.com>, Patrick McHardy <kaber@trash.net>,
netdev@vger.kernel.org (open list:ATLX ETHERNET DRI...),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 04/19] net/ethernet/atheros/atlx/atl1: Use module_pci_driver to register driver
Date: Wed, 22 May 2013 00:42:09 +0200 [thread overview]
Message-ID: <1369176146-19383-4-git-send-email-peterhuewe@gmx.de> (raw)
In-Reply-To: <1369176146-19383-1-git-send-email-peterhuewe@gmx.de>
Removing some boilerplate by using module_pci_driver instead of calling
register and unregister in the otherwise empty init/exit functions.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/net/ethernet/atheros/atlx/atl1.c | 27 ++-------------------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index fa0915f..538211d 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -3145,31 +3145,6 @@ static struct pci_driver atl1_driver = {
.driver.pm = &atl1_pm_ops,
};
-/**
- * atl1_exit_module - Driver Exit Cleanup Routine
- *
- * atl1_exit_module is called just before the driver is removed
- * from memory.
- */
-static void __exit atl1_exit_module(void)
-{
- pci_unregister_driver(&atl1_driver);
-}
-
-/**
- * atl1_init_module - Driver Registration Routine
- *
- * atl1_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- */
-static int __init atl1_init_module(void)
-{
- return pci_register_driver(&atl1_driver);
-}
-
-module_init(atl1_init_module);
-module_exit(atl1_exit_module);
-
struct atl1_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
@@ -3705,3 +3680,5 @@ static const struct ethtool_ops atl1_ethtool_ops = {
.get_ethtool_stats = atl1_get_ethtool_stats,
.get_sset_count = atl1_get_sset_count,
};
+
+module_pci_driver(atl1_driver);
--
1.8.1.5
next prev parent reply other threads:[~2013-05-21 22:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 22:42 [PATCH 01/19] net/ethernet/silan/sc92031: Use module_pci_driver to register driver Peter Huewe
2013-05-21 22:42 ` [PATCH 02/19] net/ethernet/atheros/atl1c/atl1c_main: " Peter Huewe
2013-05-21 22:42 ` [PATCH 03/19] net/ethernet/atheros/atl1e/atl1e_main: " Peter Huewe
2013-05-22 0:19 ` Hannes Frederic Sowa
2013-05-21 22:42 ` Peter Huewe [this message]
2013-05-21 22:42 ` [PATCH 05/19] net/ethernet/sis/sis190: " Peter Huewe
2013-05-21 22:42 ` [PATCH 06/19] net/ethernet/dec/tulip/xircom_cb: " Peter Huewe
2013-05-22 0:41 ` Grant Grundler
2013-05-21 22:42 ` [PATCH 07/19] net/ethernet/toshiba/tc35815: " Peter Huewe
2013-05-21 22:42 ` [PATCH 08/19] net/ethernet/icplus/ipg: " Peter Huewe
2013-05-21 22:42 ` [PATCH 09/19] net/ethernet/alteon/acenic: " Peter Huewe
2013-05-21 22:58 ` [PATCH 10/19] net/ethernet/broadcom/bnx2: " Peter Huewe
2013-05-21 22:58 ` [PATCH 11/19] net/ethernet/broadcom/tg3: " Peter Huewe
2013-05-22 0:22 ` Nithin Nayak Sujir
2013-05-21 22:58 ` [PATCH 12/19] net/ethernet/sgi/ioc3-eth: " Peter Huewe
2013-05-22 7:53 ` Ralf Baechle
2013-05-21 22:58 ` [PATCH 13/19] net/ethernet/qlogic/qlge/qlge_main: " Peter Huewe
2013-05-21 22:58 ` [PATCH 14/19] net/ethernet/sun/sungem: " Peter Huewe
2013-05-21 22:58 ` [PATCH 15/19] net/ethernet/amd/amd8111e: " Peter Huewe
2013-05-21 23:42 ` [PATCH 16/19] net/hippi/rrunner: " Peter Huewe
2013-05-21 23:42 ` [PATCH 17/19] net/fddi/skfp/skfddi: " Peter Huewe
2013-05-21 23:42 ` [PATCH 18/19] net/ethernet/chelsio/cxgb/cxgb2: " Peter Huewe
2013-05-21 23:42 ` [PATCH 19/19] net/ethernet/nvidia/forcedeth: " Peter Huewe
2013-05-22 21:44 ` [PATCH 01/19] net/ethernet/silan/sc92031: " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369176146-19383-4-git-send-email-peterhuewe@gmx.de \
--to=peterhuewe@gmx.de \
--cc=chris.snook@gmail.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=gregkh@linuxfoundation.org \
--cc=jcliburn@gmail.com \
--cc=joe@perches.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).