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 <wangyij...@huawei.com>
Cc: "Stephen M. Cameron" <scame...@beardog.cce.hp.com>
Cc: "James E.J. Bottomley" <jbottom...@parallels.com>
Cc: iss_storage...@hp.com
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/hpsa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 7f4f790..05b31f1 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4090,7 +4090,7 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
        if ((h->board_id == 0x40700E11) || (h->board_id == 0x40800E11) ||
            (h->board_id == 0x40820E11) || (h->board_id == 0x40830E11))
                goto default_int_mode;
-       if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
+       if (h->pdev->msix_cap) {
                dev_info(&h->pdev->dev, "MSIX\n");
                err = pci_enable_msix(h->pdev, hpsa_msix_entries,
                                                MAX_REPLY_QUEUES);
@@ -4110,7 +4110,7 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
                        goto default_int_mode;
                }
        }
-       if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
+       if (h->pdev->msi_cap) {
                dev_info(&h->pdev->dev, "MSI\n");
                if (!pci_enable_msi(h->pdev))
                        h->msi_vector = 1;
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to