aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/msi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 84da13c00a34..5a40516444f3 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -487,7 +487,6 @@ EXPORT_SYMBOL_GPL(pci_restore_msi_state);
487static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr, 487static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
488 char *buf) 488 char *buf)
489{ 489{
490 struct pci_dev *pdev = to_pci_dev(dev);
491 struct msi_desc *entry; 490 struct msi_desc *entry;
492 unsigned long irq; 491 unsigned long irq;
493 int retval; 492 int retval;
@@ -496,12 +495,11 @@ static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
496 if (retval) 495 if (retval)
497 return retval; 496 return retval;
498 497
499 list_for_each_entry(entry, &pdev->msi_list, list) { 498 entry = irq_get_msi_desc(irq);
500 if (entry->irq == irq) { 499 if (entry)
501 return sprintf(buf, "%s\n", 500 return sprintf(buf, "%s\n",
502 entry->msi_attrib.is_msix ? "msix" : "msi"); 501 entry->msi_attrib.is_msix ? "msix" : "msi");
503 } 502
504 }
505 return -ENODEV; 503 return -ENODEV;
506} 504}
507 505