Skip to content

Commit 8576827

Browse files
YijingWangdavem330
authored andcommitted
bnx2: use pdev->pm_cap instead of pci_find_capability(.., PCI_CAP_ID_PM)
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 <[email protected]> Cc: Michael Chan <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent f9c7da5 commit 8576827

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8104,7 +8104,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
81048104

81058105
pci_set_master(pdev);
81068106

8107-
bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
8107+
bp->pm_cap = pdev->pm_cap;
81088108
if (bp->pm_cap == 0) {
81098109
dev_err(&pdev->dev,
81108110
"Cannot find power management capability, aborting\n");

0 commit comments

Comments
 (0)