mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 06:55:13 +08:00
ixgbe: cleanup ixgbe_enumerate_functions
This function previously had the same check as used by the ixgbe_pcie_from_parent. As the hardcode is due to the device having an internal switch, this function should simply use the call from ixgbe_pcie_from_parent. This reduces code complexity and makes it less likely a developer will forget to update the list in the future. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
781798a11e
commit
f1f965793b
@ -7362,19 +7362,16 @@ static const struct net_device_ops ixgbe_netdev_ops = {
|
|||||||
**/
|
**/
|
||||||
static inline int ixgbe_enumerate_functions(struct ixgbe_adapter *adapter)
|
static inline int ixgbe_enumerate_functions(struct ixgbe_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct ixgbe_hw *hw = &adapter->hw;
|
|
||||||
struct list_head *entry;
|
struct list_head *entry;
|
||||||
int physfns = 0;
|
int physfns = 0;
|
||||||
|
|
||||||
/* Some cards can not use the generic count PCIe functions method, and
|
/* Some cards can not use the generic count PCIe functions method,
|
||||||
* so must be hardcoded to the correct value.
|
* because they are behind a parent switch, so we hardcode these with
|
||||||
|
* the correct number of functions.
|
||||||
*/
|
*/
|
||||||
switch (hw->device_id) {
|
if (ixgbe_pcie_from_parent(&adapter->hw)) {
|
||||||
case IXGBE_DEV_ID_82599_SFP_SF_QP:
|
|
||||||
case IXGBE_DEV_ID_82599_QSFP_SF_QP:
|
|
||||||
physfns = 4;
|
physfns = 4;
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
list_for_each(entry, &adapter->pdev->bus_list) {
|
list_for_each(entry, &adapter->pdev->bus_list) {
|
||||||
struct pci_dev *pdev =
|
struct pci_dev *pdev =
|
||||||
list_entry(entry, struct pci_dev, bus_list);
|
list_entry(entry, struct pci_dev, bus_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user