PCI/sysfs: Use pci_irq_vector()

instead of fiddling with MSI descriptors.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20211206210224.265589103@linutronix.de
This commit is contained in:
Thomas Gleixner 2021-12-06 23:27:36 +01:00
parent ade044a3d0
commit 793c500676

View File

@ -62,11 +62,8 @@ static ssize_t irq_show(struct device *dev,
* For MSI, show the first MSI IRQ; for all other cases including * For MSI, show the first MSI IRQ; for all other cases including
* MSI-X, show the legacy INTx IRQ. * MSI-X, show the legacy INTx IRQ.
*/ */
if (pdev->msi_enabled) { if (pdev->msi_enabled)
struct msi_desc *desc = first_pci_msi_entry(pdev); return sysfs_emit(buf, "%u\n", pci_irq_vector(pdev, 0));
return sysfs_emit(buf, "%u\n", desc->irq);
}
#endif #endif
return sysfs_emit(buf, "%u\n", pdev->irq); return sysfs_emit(buf, "%u\n", pdev->irq);