diff options
author | Ahmed S. Darwish <darwi@linutronix.de> | 2022-11-11 16:54:54 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-11-17 17:15:21 +0300 |
commit | 059f778d66ba88e1acad89a46cfb35eb8703feef (patch) | |
tree | 96286eecf1d25568ab0958bb10895a741686715b /drivers/pci/msi/api.c | |
parent | 017239c8db209307d2acfc0f9a3b104c39f911b3 (diff) | |
download | linux-059f778d66ba88e1acad89a46cfb35eb8703feef.tar.xz |
PCI/MSI: Move pci_free_irq_vectors() to api.c
To disentangle the maze in msi.c, all exported device-driver MSI APIs are
now to be grouped in one file, api.c.
Move pci_free_irq_vectors() and make its kernel-doc comprehensive.
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20221111122015.042870570@linutronix.de
Diffstat (limited to 'drivers/pci/msi/api.c')
-rw-r--r-- | drivers/pci/msi/api.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index 0f1ec87e3f9f..2ff2a9ccfc47 100644 --- a/drivers/pci/msi/api.c +++ b/drivers/pci/msi/api.c @@ -205,3 +205,18 @@ int pci_irq_vector(struct pci_dev *dev, unsigned int nr) return irq ? irq : -EINVAL; } EXPORT_SYMBOL(pci_irq_vector); + +/** + * pci_free_irq_vectors() - Free previously allocated IRQs for a device + * @dev: the PCI device to operate on + * + * Undo the interrupt vector allocations and possible device MSI/MSI-X + * enablement earlier done through pci_alloc_irq_vectors_affinity() or + * pci_alloc_irq_vectors(). + */ +void pci_free_irq_vectors(struct pci_dev *dev) +{ + pci_disable_msix(dev); + pci_disable_msi(dev); +} +EXPORT_SYMBOL(pci_free_irq_vectors); |