Merge commit 'v3.6-rc5' into pci/gavin-window-alignment
[cascardo/linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_main.c
index 2105498..605c457 100644 (file)
@@ -1162,14 +1162,9 @@ static int bnx2x_send_final_clnup(struct bnx2x *bp, u8 clnup_func,
 
 static u8 bnx2x_is_pcie_pending(struct pci_dev *dev)
 {
-       int pos;
        u16 status;
 
-       pos = pci_pcie_cap(dev);
-       if (!pos)
-               return false;
-
-       pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, &status);
+       pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &status);
        return status & PCI_EXP_DEVSTA_TRPND;
 }
 
@@ -6135,8 +6130,7 @@ static void bnx2x_init_pxp(struct bnx2x *bp)
        u16 devctl;
        int r_order, w_order;
 
-       pci_read_config_word(bp->pdev,
-                            pci_pcie_cap(bp->pdev) + PCI_EXP_DEVCTL, &devctl);
+       pcie_capability_read_word(bp->pdev, PCI_EXP_DEVCTL, &devctl);
        DP(NETIF_MSG_HW, "read 0x%x from devctl\n", devctl);
        w_order = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
        if (bp->mrrs == -1)
@@ -9374,7 +9368,7 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp)
 
 static int __devinit bnx2x_do_flr(struct bnx2x *bp)
 {
-       int i, pos;
+       int i;
        u16 status;
        struct pci_dev *dev = bp->pdev;
 
@@ -9391,16 +9385,12 @@ static int __devinit bnx2x_do_flr(struct bnx2x *bp)
                return -EINVAL;
        }
 
-       pos = pci_pcie_cap(dev);
-       if (!pos)
-               return -ENOTTY;
-
        /* Wait for Transaction Pending bit clean */
        for (i = 0; i < 4; i++) {
                if (i)
                        msleep((1 << (i - 1)) * 100);
 
-               pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, &status);
+               pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &status);
                if (!(status & PCI_EXP_DEVSTA_TRPND))
                        goto clear;
        }