소스 검색

igb: remove unnecessary reads of PCI_CAP_ID_EXP

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jon Mason 14 년 전
부모
커밋
bdaae04c65
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      drivers/net/igb/igb_main.c

+ 2 - 2
drivers/net/igb/igb_main.c

@@ -6267,7 +6267,7 @@ s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 	struct igb_adapter *adapter = hw->back;
 	struct igb_adapter *adapter = hw->back;
 	u16 cap_offset;
 	u16 cap_offset;
 
 
-	cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
+	cap_offset = adapter->pdev->pcie_cap;
 	if (!cap_offset)
 	if (!cap_offset)
 		return -E1000_ERR_CONFIG;
 		return -E1000_ERR_CONFIG;
 
 
@@ -6281,7 +6281,7 @@ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 	struct igb_adapter *adapter = hw->back;
 	struct igb_adapter *adapter = hw->back;
 	u16 cap_offset;
 	u16 cap_offset;
 
 
-	cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
+	cap_offset = adapter->pdev->pcie_cap;
 	if (!cap_offset)
 	if (!cap_offset)
 		return -E1000_ERR_CONFIG;
 		return -E1000_ERR_CONFIG;