From: Casey Leedom <leedom@chelsio.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Casey Leedom <leedom@chelsio.com>
Subject: [PATCH net-26 2/5] cxgb4vf: Check driver parameters in the right place ...
Date: Fri, 11 Feb 2011 17:00:20 -0800 [thread overview]
Message-ID: <1297472423-15672-3-git-send-email-leedom@chelsio.com> (raw)
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
Check module parameter validity in the module initialization routine instead
of the PCI Device Probe routine.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/cxgb4vf_main.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 08c2b29..b12c169 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2513,17 +2513,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
struct net_device *netdev;
/*
- * Vet our module parameters.
- */
- if (msi != MSI_MSIX && msi != MSI_MSI) {
- dev_err(&pdev->dev, "bad module parameter msi=%d; must be %d"
- " (MSI-X or MSI) or %d (MSI)\n", msi, MSI_MSIX,
- MSI_MSI);
- err = -EINVAL;
- goto err_out;
- }
-
- /*
* Print our driver banner the first time we're called to initialize a
* device.
*/
@@ -2826,7 +2815,6 @@ err_release_regions:
err_disable_device:
pci_disable_device(pdev);
-err_out:
return err;
}
@@ -2939,6 +2927,17 @@ static int __init cxgb4vf_module_init(void)
{
int ret;
+ /*
+ * Vet our module parameters.
+ */
+ if (msi != MSI_MSIX && msi != MSI_MSI) {
+ printk(KERN_WARNING KBUILD_MODNAME
+ ": bad module parameter msi=%d; must be %d"
+ " (MSI-X or MSI) or %d (MSI)\n",
+ msi, MSI_MSIX, MSI_MSI);
+ return -EINVAL;
+ }
+
/* Debugfs support is optional, just warn if this fails */
cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (!cxgb4vf_debugfs_root)
--
1.7.0.4
next prev parent reply other threads:[~2011-02-12 1:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-12 1:00 [PATCH net-26 0/5] cxgb4vf: minor bug fixes Casey Leedom
2011-02-12 1:00 ` [PATCH net-26 1/5] cxgb4vf: Virtual Interfaces are always up Casey Leedom
2011-02-12 5:19 ` David Miller
2011-02-14 19:13 ` Casey Leedom
2011-02-14 22:31 ` Casey Leedom
2011-02-14 22:34 ` David Miller
2011-02-12 1:00 ` Casey Leedom [this message]
2011-02-12 1:00 ` [PATCH net-26 3/5] cxgb4vf: Behave properly when CONFIG_DEBUG_FS isn't defined Casey Leedom
2011-02-12 1:00 ` [PATCH net-26 4/5] cxgb4vf: Quiesce Virtual Interfaces on shutdown Casey Leedom
2011-02-12 7:17 ` Anirban Chakraborty
2011-02-14 19:01 ` Casey Leedom
2011-02-12 1:00 ` [PATCH net-26 5/5] cxgb4vf: Use defined Mailbox Timeout Casey Leedom
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=1297472423-15672-3-git-send-email-leedom@chelsio.com \
--to=leedom@chelsio.com \
--cc=davem@davemloft.net \
--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).