Commit bb14a1af authored by Casey Leedom's avatar Casey Leedom Committed by David S. Miller

cxgb4vf: Check driver parameters in the right place ...

Check module parameter validity in the module initialization routine instead
of the PCI Device Probe routine.
Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 98200ec2
...@@ -2488,17 +2488,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, ...@@ -2488,17 +2488,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
struct port_info *pi; struct port_info *pi;
struct net_device *netdev; 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 * Print our driver banner the first time we're called to initialize a
* device. * device.
...@@ -2802,7 +2791,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, ...@@ -2802,7 +2791,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
err_disable_device: err_disable_device:
pci_disable_device(pdev); pci_disable_device(pdev);
err_out:
return err; return err;
} }
...@@ -2915,6 +2903,17 @@ static int __init cxgb4vf_module_init(void) ...@@ -2915,6 +2903,17 @@ static int __init cxgb4vf_module_init(void)
{ {
int ret; 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 */ /* Debugfs support is optional, just warn if this fails */
cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (!cxgb4vf_debugfs_root) if (!cxgb4vf_debugfs_root)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment