Skip to content

Commit 34c5693

Browse files
Robert Richterhtejun
authored andcommitted
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: kbuild test robot <[email protected]> Signed-off-by: Robert Richter <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent b7ae128 commit 34c5693

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

drivers/ata/ahci.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
12031203
{}
12041204
#endif
12051205

1206-
static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry)
1207-
{
1208-
struct msi_desc *desc;
1209-
1210-
list_for_each_entry(desc, &dev->msi_list, list) {
1211-
if (desc->msi_attrib.entry_nr == entry)
1212-
return desc;
1213-
}
1214-
1215-
return NULL;
1216-
}
1217-
12181206
/*
12191207
* ahci_init_msix() only implements single MSI-X support, not multiple
12201208
* 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)
12231211
static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports,
12241212
struct ahci_host_priv *hpriv)
12251213
{
1226-
struct msi_desc *desc;
12271214
int rc, nvec;
12281215
struct msix_entry entry = {};
12291216

@@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports,
12481235
if (rc < 0)
12491236
goto fail;
12501237

1251-
desc = msix_get_desc(pdev, 0); /* first entry */
1252-
if (!desc) {
1253-
rc = -EINVAL;
1254-
goto fail;
1255-
}
1256-
1257-
hpriv->irq = desc->irq;
1238+
hpriv->irq = entry.vector;
12581239

12591240
return 1;
12601241
fail:

0 commit comments

Comments
 (0)