Skip to content

Commit 555a842

Browse files
YijingWangdavem330
authored andcommitted
bnx2: clean up unnecessary MSI/MSI-X capability find
PCI core will initialize device MSI/MSI-X capability in pci_msi_init_pci_dev(). So device driver should use pci_dev->msi_cap/msix_cap to determine whether the device support MSI/MSI-X instead of using pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX). Access to PCIe device config space again will consume more time. Signed-off-by: Yijing Wang <[email protected]> Cc: Michael Chan <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 77273ea commit 555a842

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8139,13 +8139,13 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
81398139

81408140
if (BNX2_CHIP(bp) == BNX2_CHIP_5709 &&
81418141
BNX2_CHIP_REV(bp) != BNX2_CHIP_REV_Ax) {
8142-
if (pci_find_capability(pdev, PCI_CAP_ID_MSIX))
8142+
if (pdev->msix_cap)
81438143
bp->flags |= BNX2_FLAG_MSIX_CAP;
81448144
}
81458145

81468146
if (BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A0 &&
81478147
BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A1) {
8148-
if (pci_find_capability(pdev, PCI_CAP_ID_MSI))
8148+
if (pdev->msi_cap)
81498149
bp->flags |= BNX2_FLAG_MSI_CAP;
81508150
}
81518151

0 commit comments

Comments
 (0)