Skip to content

Commit ccf8f53

Browse files
Alexander Gordeevhtejun
authored andcommitted
ahci: Use pci_enable_msi_exact() instead of pci_enable_msi_range()
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>
1 parent ab0f9e7 commit ccf8f53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/ata/ahci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
11661166
static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
11671167
struct ahci_host_priv *hpriv)
11681168
{
1169-
int nvec;
1169+
int rc, nvec;
11701170

11711171
if (hpriv->flags & AHCI_HFLAG_NO_MSI)
11721172
goto intx;
@@ -1183,10 +1183,10 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
11831183
if (nvec < n_ports)
11841184
goto single_msi;
11851185

1186-
nvec = pci_enable_msi_range(pdev, nvec, nvec);
1187-
if (nvec == -ENOSPC)
1186+
rc = pci_enable_msi_exact(pdev, nvec);
1187+
if (rc == -ENOSPC)
11881188
goto single_msi;
1189-
else if (nvec < 0)
1189+
else if (rc < 0)
11901190
goto intx;
11911191

11921192
/* fallback to single MSI mode if the controller enforced MRSM mode */

0 commit comments

Comments
 (0)