Skip to content

Commit

Permalink
ahci: Use pci_enable_msi_exact() instead of pci_enable_msi_range()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Gordeev authored and Tejun Heo committed Apr 17, 2014
1 parent ab0f9e7 commit ccf8f53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit ccf8f53

Please sign in to comment.