ahci: Use pci_enable_msi_exact() instead of pci_enable_msi_range()
authorAlexander Gordeev <agordeev@redhat.com>
Thu, 17 Apr 2014 12:13:50 +0000 (14:13 +0200)
committerTejun Heo <tj@kernel.org>
Thu, 17 Apr 2014 13:59:24 +0000 (09:59 -0400)
The driver calls pci_enable_msi_range() function with the range of
[nvec..nvec] which is what pci_enable_msi_exact() function is for.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/ahci.c

index f6b3e31f63cd57cc61bcb4803f506320681a8071..44d40c746982e636e549b965e05e09c7e040711f 100644 (file)
@@ -1166,7 +1166,7 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
 static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
                                struct ahci_host_priv *hpriv)
 {
-       int nvec;
+       int rc, nvec;
 
        if (hpriv->flags & AHCI_HFLAG_NO_MSI)
                goto intx;
@@ -1183,10 +1183,10 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
        if (nvec < n_ports)
                goto single_msi;
 
-       nvec = pci_enable_msi_range(pdev, nvec, nvec);
-       if (nvec == -ENOSPC)
+       rc = pci_enable_msi_exact(pdev, nvec);
+       if (rc == -ENOSPC)
                goto single_msi;
-       else if (nvec < 0)
+       else if (rc < 0)
                goto intx;
 
        /* fallback to single MSI mode if the controller enforced MRSM mode */