summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoopa Prabhu <roprabhu@cisco.com>2012-01-18 04:24:07 +0000
committerDavid S. Miller <davem@davemloft.net>2012-01-18 16:16:41 -0500
commitca2b721de25b9893310fd695a38b495d14c70ff3 (patch)
treecea0019bbd7125d4682011ab7de1c9d58b3e4db9
parent7335903cba523fc2fd801a178a0e4fcf8ccae756 (diff)
downloadlinux-3.10-ca2b721de25b9893310fd695a38b495d14c70ff3.tar.gz
linux-3.10-ca2b721de25b9893310fd695a38b495d14c70ff3.tar.bz2
linux-3.10-ca2b721de25b9893310fd695a38b495d14c70ff3.zip
enic: rearrange some of the port profile code
This patch rearranges some of the port profile code in enic_probe. It moves out some lines of port profile related code currently inside CONFIG_PCI_IOV. This is only done to move all port profile related code together so that it can help isolate the port profile handling code under a separate #ifdef in our internal build scripts. Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 9f37d92fc76..03b0577bd61 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -2270,10 +2270,10 @@ static int __devinit enic_probe(struct pci_dev *pdev,
int using_dac = 0;
unsigned int i;
int err;
- int num_pps = 1;
#ifdef CONFIG_PCI_IOV
int pos = 0;
#endif
+ int num_pps;
/* Allocate net device structure and initialize. Private
* instance data is initialized to zero.
@@ -2380,17 +2380,17 @@ static int __devinit enic_probe(struct pci_dev *pdev,
goto err_out_vnic_unregister;
}
enic->priv_flags |= ENIC_SRIOV_ENABLED;
- num_pps = enic->num_vfs;
}
}
-
#endif
+
+ num_pps = enic->num_vfs ? enic->num_vfs : 1;
/* Allocate structure for port profiles */
enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL);
if (!enic->pp) {
pr_err("port profile alloc failed, aborting\n");
err = -ENOMEM;
- goto err_out_disable_sriov;
+ goto err_out_disable_sriov_pp;
}
/* Issue device open to get device in known state
@@ -2399,7 +2399,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
err = enic_dev_open(enic);
if (err) {
dev_err(dev, "vNIC dev open failed, aborting\n");
- goto err_out_free_pp;
+ goto err_out_disable_sriov;
}
/* Setup devcmd lock
@@ -2522,9 +2522,9 @@ err_out_dev_deinit:
enic_dev_deinit(enic);
err_out_dev_close:
vnic_dev_close(enic->vdev);
-err_out_free_pp:
- kfree(enic->pp);
err_out_disable_sriov:
+ kfree(enic->pp);
+err_out_disable_sriov_pp:
#ifdef CONFIG_PCI_IOV
if (enic_sriov_enabled(enic)) {
pci_disable_sriov(pdev);