niu: remove unnecessary read of PCI_CAP_ID_EXP
authorJon Mason <jdmason@kudzu.us>
Mon, 27 Jun 2011 07:45:44 +0000 (07:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jun 2011 04:40:45 +0000 (21:40 -0700)
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>
drivers/net/niu.c

index 1c7b790217f95198dbc22d391945e24c056ffe2e..cd6c2317e29e3bb82f555c10816dc4b18bedf1b7 100644 (file)
@@ -9797,7 +9797,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
                goto err_out_disable_pdev;
        }
 
-       pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+       pos = pci_pcie_cap(pdev);
        if (pos <= 0) {
                dev_err(&pdev->dev, "Cannot find PCI Express capability, aborting\n");
                goto err_out_free_res;