ahci: Use pci_enable_msi_range() instead of pci_enable_msi_block()

pci_enable_msi_block() has been deprecated; use pci_enable_msi_range()
instead.

[bhelgaas: changelog]
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Alexander Gordeev 2014-01-29 14:19:43 -07:00 committed by Bjorn Helgaas
parent bc03fd3a8a
commit fc061d969f
1 changed files with 9 additions and 11 deletions

View File

@ -1151,13 +1151,13 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
struct ahci_host_priv *hpriv) struct ahci_host_priv *hpriv)
{ {
int rc, nvec; int nvec;
if (hpriv->flags & AHCI_HFLAG_NO_MSI) if (hpriv->flags & AHCI_HFLAG_NO_MSI)
goto intx; goto intx;
rc = pci_msi_vec_count(pdev); nvec = pci_msi_vec_count(pdev);
if (rc < 0) if (nvec < 0)
goto intx; goto intx;
/* /*
@ -1165,21 +1165,19 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
* Message mode could be enforced. In this case assume that advantage * Message mode could be enforced. In this case assume that advantage
* of multipe MSIs is negated and use single MSI mode instead. * of multipe MSIs is negated and use single MSI mode instead.
*/ */
if (rc < n_ports) if (nvec < n_ports)
goto single_msi; goto single_msi;
nvec = rc; nvec = pci_enable_msi_range(pdev, nvec, nvec);
rc = pci_enable_msi_block(pdev, nvec); if (nvec == -ENOSPC)
if (rc < 0)
goto intx;
else if (rc > 0)
goto single_msi; goto single_msi;
else if (nvec < 0)
goto intx;
return nvec; return nvec;
single_msi: single_msi:
rc = pci_enable_msi(pdev); if (pci_enable_msi(pdev))
if (rc)
goto intx; goto intx;
return 1; return 1;