]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
igb: remove unnecessary reads of PCI_CAP_ID_EXP
authorJon Mason <jdmason@kudzu.us>
Mon, 27 Jun 2011 07:44:01 +0000 (07:44 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 08:19:29 +0000 (16:19 +0800)
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>
(cherry picked from commit bdaae04c65ef88645f50dabb43992033c754c4a7)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/igb/igb_main.c

index 37688868b7a3236c40a6821584232c59bd96f90b..c5e8fea1d04c456896124aa33c1f8b2b05bdb45a 100644 (file)
@@ -6272,7 +6272,7 @@ s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
        struct igb_adapter *adapter = hw->back;
        u16 cap_offset;
 
-       cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
+       cap_offset = adapter->pdev->pcie_cap;
        if (!cap_offset)
                return -E1000_ERR_CONFIG;
 
@@ -6286,7 +6286,7 @@ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
        struct igb_adapter *adapter = hw->back;
        u16 cap_offset;
 
-       cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
+       cap_offset = adapter->pdev->pcie_cap;
        if (!cap_offset)
                return -E1000_ERR_CONFIG;