aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoopa Prabhu <roprabhu@cisco.com>2012-01-17 23:24:07 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-18 16:16:41 -0500
commitca2b721de25b9893310fd695a38b495d14c70ff3 (patch)
treecea0019bbd7125d4682011ab7de1c9d58b3e4db9 /drivers
parent7335903cba523fc2fd801a178a0e4fcf8ccae756 (diff)
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>
Diffstat (limited to 'drivers')
-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 9f37d92fc76d..03b0577bd619 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,
2270 int using_dac = 0; 2270 int using_dac = 0;
2271 unsigned int i; 2271 unsigned int i;
2272 int err; 2272 int err;
2273 int num_pps = 1;
2274#ifdef CONFIG_PCI_IOV 2273#ifdef CONFIG_PCI_IOV
2275 int pos = 0; 2274 int pos = 0;
2276#endif 2275#endif
2276 int num_pps;
2277 2277
2278 /* Allocate net device structure and initialize. Private 2278 /* Allocate net device structure and initialize. Private
2279 * instance data is initialized to zero. 2279 * instance data is initialized to zero.
@@ -2380,17 +2380,17 @@ static int __devinit enic_probe(struct pci_dev *pdev,
2380 goto err_out_vnic_unregister; 2380 goto err_out_vnic_unregister;
2381 } 2381 }
2382 enic->priv_flags |= ENIC_SRIOV_ENABLED; 2382 enic->priv_flags |= ENIC_SRIOV_ENABLED;
2383 num_pps = enic->num_vfs;
2384 } 2383 }
2385 } 2384 }
2386
2387#endif 2385#endif
2386
2387 num_pps = enic->num_vfs ? enic->num_vfs : 1;
2388 /* Allocate structure for port profiles */ 2388 /* Allocate structure for port profiles */
2389 enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL); 2389 enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL);
2390 if (!enic->pp) { 2390 if (!enic->pp) {
2391 pr_err("port profile alloc failed, aborting\n"); 2391 pr_err("port profile alloc failed, aborting\n");
2392 err = -ENOMEM; 2392 err = -ENOMEM;
2393 goto err_out_disable_sriov; 2393 goto err_out_disable_sriov_pp;
2394 } 2394 }
2395 2395
2396 /* Issue device open to get device in known state 2396 /* Issue device open to get device in known state
@@ -2399,7 +2399,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
2399 err = enic_dev_open(enic); 2399 err = enic_dev_open(enic);
2400 if (err) { 2400 if (err) {
2401 dev_err(dev, "vNIC dev open failed, aborting\n"); 2401 dev_err(dev, "vNIC dev open failed, aborting\n");
2402 goto err_out_free_pp; 2402 goto err_out_disable_sriov;
2403 } 2403 }
2404 2404
2405 /* Setup devcmd lock 2405 /* Setup devcmd lock
@@ -2522,9 +2522,9 @@ err_out_dev_deinit:
2522 enic_dev_deinit(enic); 2522 enic_dev_deinit(enic);
2523err_out_dev_close: 2523err_out_dev_close:
2524 vnic_dev_close(enic->vdev); 2524 vnic_dev_close(enic->vdev);
2525err_out_free_pp:
2526 kfree(enic->pp);
2527err_out_disable_sriov: 2525err_out_disable_sriov:
2526 kfree(enic->pp);
2527err_out_disable_sriov_pp:
2528#ifdef CONFIG_PCI_IOV 2528#ifdef CONFIG_PCI_IOV
2529 if (enic_sriov_enabled(enic)) { 2529 if (enic_sriov_enabled(enic)) {
2530 pci_disable_sriov(pdev); 2530 pci_disable_sriov(pdev);