be2net: fix to correctly know if driver needs to run for a VF or a PF
authorAjit Khaparde <ajitk@serverengines.com>
Thu, 29 Jul 2010 06:15:32 +0000 (06:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jul 2010 06:59:05 +0000 (23:59 -0700)
Move be_check_sriov_fn_type to appropriate place to correctly determine
if the be2net driver needs to work as a VF driver or a PF driver.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_main.c

index d5b097d836b9ffcc883e8e9b349bb02ca0d5d363..e72b482c4327e06febb5d44f19a27ac97f7102bc 100644 (file)
@@ -1717,10 +1717,11 @@ static void be_msix_enable(struct be_adapter *adapter)
 
 static void be_sriov_enable(struct be_adapter *adapter)
 {
-#ifdef CONFIG_PCI_IOV
-       int status;
        be_check_sriov_fn_type(adapter);
+#ifdef CONFIG_PCI_IOV
        if (be_physfn(adapter) && num_vfs) {
+               int status;
+
                status = pci_enable_sriov(adapter->pdev, num_vfs);
                adapter->sriov_enabled = status ? false : true;
        }