Skip to content

Commit

Permalink
bnx2: use pdev->pm_cap instead of pci_find_capability(.., PCI_CAP_ID_PM)
Browse files Browse the repository at this point in the history
Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
in init path. So we can use pdev->pm_cap instead of using
pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Michael Chan <mchan@broadcom.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yijing Wang authored and David S. Miller committed Jun 20, 2013
1 parent f9c7da5 commit 8576827
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -8104,7 +8104,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)

pci_set_master(pdev);

bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
bp->pm_cap = pdev->pm_cap;
if (bp->pm_cap == 0) {
dev_err(&pdev->dev,
"Cannot find power management capability, aborting\n");
Expand Down

0 comments on commit 8576827

Please sign in to comment.