Commit 34c56932 authored by Robert Richter's avatar Robert Richter Committed by Tejun Heo

ahci, msix: Fix build error for !PCI_MSI

It turned out the irq vector of the msix can be obtained from struct
msix_entry. This makes the lookup function for msi_desc obsolete.

This fixes a build error if PCI_MSI is unset:

 drivers/ata/ahci.c: In function ‘msix_get_desc’:
 drivers/ata/ahci.c:1210:2: error: ‘struct pci_dev’ has no member named ‘msi_list’

Catched by Fengguang's build bot.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarRobert Richter <rrichter@cavium.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent b7ae128d
...@@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) ...@@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
{} {}
#endif #endif
static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry)
{
struct msi_desc *desc;
list_for_each_entry(desc, &dev->msi_list, list) {
if (desc->msi_attrib.entry_nr == entry)
return desc;
}
return NULL;
}
/* /*
* ahci_init_msix() only implements single MSI-X support, not multiple * ahci_init_msix() only implements single MSI-X support, not multiple
* MSI-X per-port interrupts. This is needed for host controllers that only * MSI-X per-port interrupts. This is needed for host controllers that only
...@@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) ...@@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry)
static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports,
struct ahci_host_priv *hpriv) struct ahci_host_priv *hpriv)
{ {
struct msi_desc *desc;
int rc, nvec; int rc, nvec;
struct msix_entry entry = {}; struct msix_entry entry = {};
...@@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, ...@@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports,
if (rc < 0) if (rc < 0)
goto fail; goto fail;
desc = msix_get_desc(pdev, 0); /* first entry */ hpriv->irq = entry.vector;
if (!desc) {
rc = -EINVAL;
goto fail;
}
hpriv->irq = desc->irq;
return 1; return 1;
fail: fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment