[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1409650616-1035-6-git-send-email-sakiwit@gmail.com>
Date: Tue, 2 Sep 2014 03:36:55 -0600
From: Jean Sacren <sakiwit@...il.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: linux.nics@...el.com, e1000-devel@...ts.sourceforge.net,
netdev@...r.kernel.org
Subject: [PATCH net-next 5/6] e1000e: remove the boilerplate of e1000e module for init/exit
Use module_pci_driver() to simplify e1000e driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@...il.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 35 +++++-------------------------
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 65c3aef2bd36..1b5f99028ac6 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6741,6 +6741,10 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
u16 eeprom_apme_mask = E1000_EEPROM_APME;
s32 rval = 0;
+ pr_info_once("Intel(R) PRO/1000 Network Driver - %s\n",
+ e1000e_driver_version);
+ pr_info_once("Copyright(c) 1999 - 2014 Intel Corporation.\n");
+
if (ei->flags2 & FLAG2_DISABLE_ASPM_L0S)
aspm_disable_flag = PCIE_LINK_STATE_L0S;
if (ei->flags2 & FLAG2_DISABLE_ASPM_L1)
@@ -7249,36 +7253,7 @@ static struct pci_driver e1000_driver = {
.err_handler = &e1000_err_handler
};
-/**
- * e1000_init_module - Driver Registration Routine
- *
- * e1000_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init e1000_init_module(void)
-{
- int ret;
-
- pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
- e1000e_driver_version);
- pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n");
- ret = pci_register_driver(&e1000_driver);
-
- return ret;
-}
-module_init(e1000_init_module);
-
-/**
- * e1000_exit_module - Driver Exit Cleanup Routine
- *
- * e1000_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit e1000_exit_module(void)
-{
- pci_unregister_driver(&e1000_driver);
-}
-module_exit(e1000_exit_module);
+module_pci_driver(e1000_driver);
MODULE_AUTHOR("Intel Corporation, <linux.nics@...el.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
--
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