aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@redhat.com>2014-01-29 16:19:43 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-02-14 16:22:41 -0500
commitfc061d969f9a44bcf200c557a77fe5e5af8ab363 (patch)
tree7f219e5a850e59be83eb9c3a9ec298b0986087ef /drivers/ata
parentbc03fd3a8a95a13ecce413790f75f6e1a0f54d27 (diff)
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 3c5f35ef7e55..023710905289 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1151,13 +1151,13 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
1151static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, 1151static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
1152 struct ahci_host_priv *hpriv) 1152 struct ahci_host_priv *hpriv)
1153{ 1153{
1154 int rc, nvec; 1154 int nvec;
1155 1155
1156 if (hpriv->flags & AHCI_HFLAG_NO_MSI) 1156 if (hpriv->flags & AHCI_HFLAG_NO_MSI)
1157 goto intx; 1157 goto intx;
1158 1158
1159 rc = pci_msi_vec_count(pdev); 1159 nvec = pci_msi_vec_count(pdev);
1160 if (rc < 0) 1160 if (nvec < 0)
1161 goto intx; 1161 goto intx;
1162 1162
1163 /* 1163 /*
@@ -1165,21 +1165,19 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
1165 * Message mode could be enforced. In this case assume that advantage 1165 * Message mode could be enforced. In this case assume that advantage
1166 * of multipe MSIs is negated and use single MSI mode instead. 1166 * of multipe MSIs is negated and use single MSI mode instead.
1167 */ 1167 */
1168 if (rc < n_ports) 1168 if (nvec < n_ports)
1169 goto single_msi; 1169 goto single_msi;
1170 1170
1171 nvec = rc; 1171 nvec = pci_enable_msi_range(pdev, nvec, nvec);
1172 rc = pci_enable_msi_block(pdev, nvec); 1172 if (nvec == -ENOSPC)
1173 if (rc < 0)
1174 goto intx;
1175 else if (rc > 0)
1176 goto single_msi; 1173 goto single_msi;
1174 else if (nvec < 0)
1175 goto intx;
1177 1176
1178 return nvec; 1177 return nvec;
1179 1178
1180single_msi: 1179single_msi:
1181 rc = pci_enable_msi(pdev); 1180 if (pci_enable_msi(pdev))
1182 if (rc)
1183 goto intx; 1181 goto intx;
1184 return 1; 1182 return 1;
1185 1183