]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_main.c
index c319e4c431fbc2f7c7694fb8913e5e8dadbb5fe5..f7ed122f40717ee4392041e09e1b2396e640370b 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;
 }
 
@@ -6141,8 +6136,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)
@@ -9390,7 +9384,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;
 
@@ -9407,16 +9401,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;
        }
@@ -12177,7 +12167,7 @@ static void bnx2x_io_resume(struct pci_dev *pdev)
        rtnl_unlock();
 }
 
-static struct pci_error_handlers bnx2x_err_handler = {
+static const struct pci_error_handlers bnx2x_err_handler = {
        .error_detected = bnx2x_io_error_detected,
        .slot_reset     = bnx2x_io_slot_reset,
        .resume         = bnx2x_io_resume,