From patchwork Tue Sep 2 09:36:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?J=CE=B5an_Sacren?= X-Patchwork-Id: 385026 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3C58B1400D2 for ; Tue, 2 Sep 2014 19:37:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339AbaIBJhM (ORCPT ); Tue, 2 Sep 2014 05:37:12 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:64997 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbaIBJhJ (ORCPT ); Tue, 2 Sep 2014 05:37:09 -0400 Received: by mail-pd0-f170.google.com with SMTP id r10so8209720pdi.29 for ; Tue, 02 Sep 2014 02:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=q/+5PkYxaR8LJIUGu5R/U9qmHNxFTfNlLSVi07Nurdw=; b=o5oqLTE1CLHh6WV63BbCe+j3PWWb/jSBaHs5hjZbJUrs5OT9ynYvv6SW1G0AXVYWu+ X0KdDERD1OuJc6dQfep5KCvTkHnsND1nygalP+V6lypGMMfuRLJ5G1iuCOOsPhLWkxq0 QroHeaaL1x8jvB/IPcbR3g+FX98/lM3RRwtj4AvsRzeZDHNoplkI7XkN/0+EM16hJX3D RhOiX2yQVZ66fuXfCjIjgRzNRWskT6Vz9It/Jab/NMd7EKFEoqEqHYWK0RtnN4tWQDtY ciirldx8orzCK3hi49g09va5FQcujERpLtAD2ZMpTNCajSHfSnWKZP5Hwgzh0CZzErcs GdEA== X-Received: by 10.66.190.169 with SMTP id gr9mr44905811pac.3.1409650628906; Tue, 02 Sep 2014 02:37:08 -0700 (PDT) Received: from localhost ([76.8.208.138]) by mx.google.com with ESMTPSA id j1sm4685444pdf.72.2014.09.02.02.37.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 02:37:08 -0700 (PDT) From: Jean Sacren To: Jeff Kirsher Cc: linux.nics@intel.com, e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH net-next 1/6] ixgb: remove the boilerplate of ixgb module for init/exit Date: Tue, 2 Sep 2014 03:36:51 -0600 Message-Id: <1409650616-1035-2-git-send-email-sakiwit@gmail.com> X-Mailer: git-send-email 1.8.5.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use module_pci_driver() to simplify ixgb 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 --- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 39 ++++------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index 055961b0f24b..339e1535482e 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c @@ -70,8 +70,6 @@ static const struct pci_device_id ixgb_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, ixgb_pci_tbl); /* Local Function Prototypes */ -static int ixgb_init_module(void); -static void ixgb_exit_module(void); static int ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent); static void ixgb_remove(struct pci_dev *pdev); static int ixgb_sw_init(struct ixgb_adapter *adapter); @@ -141,38 +139,7 @@ static int debug = -1; module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); -/** - * ixgb_init_module - Driver Registration Routine - * - * ixgb_init_module is the first routine called when the driver is - * loaded. All it does is register with the PCI subsystem. - **/ - -static int __init -ixgb_init_module(void) -{ - pr_info("%s - version %s\n", ixgb_driver_string, ixgb_driver_version); - pr_info("%s\n", ixgb_copyright); - - return pci_register_driver(&ixgb_driver); -} - -module_init(ixgb_init_module); - -/** - * ixgb_exit_module - Driver Exit Cleanup Routine - * - * ixgb_exit_module is called just before the driver is removed - * from memory. - **/ - -static void __exit -ixgb_exit_module(void) -{ - pci_unregister_driver(&ixgb_driver); -} - -module_exit(ixgb_exit_module); +module_pci_driver(ixgb_driver); /** * ixgb_irq_disable - Mask off interrupt generation on the NIC @@ -403,6 +370,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int i; int err; + pr_info_once("%s - version %s\n", + ixgb_driver_string, ixgb_driver_version); + pr_info_once("%s\n", ixgb_copyright); + err = pci_enable_device(pdev); if (err) return err;