Skip to content

Commit 059f778

Browse files
Ahmed S. DarwishKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 017239c commit 059f778

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

drivers/pci/msi/api.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,18 @@ int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
205205
return irq ? irq : -EINVAL;
206206
}
207207
EXPORT_SYMBOL(pci_irq_vector);
208+
209+
/**
210+
* pci_free_irq_vectors() - Free previously allocated IRQs for a device
211+
* @dev: the PCI device to operate on
212+
*
213+
* Undo the interrupt vector allocations and possible device MSI/MSI-X
214+
* enablement earlier done through pci_alloc_irq_vectors_affinity() or
215+
* pci_alloc_irq_vectors().
216+
*/
217+
void pci_free_irq_vectors(struct pci_dev *dev)
218+
{
219+
pci_disable_msix(dev);
220+
pci_disable_msi(dev);
221+
}
222+
EXPORT_SYMBOL(pci_free_irq_vectors);

drivers/pci/msi/msi.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -886,19 +886,6 @@ int __pci_enable_msix_range(struct pci_dev *dev,
886886
}
887887
}
888888

889-
/**
890-
* pci_free_irq_vectors - free previously allocated IRQs for a device
891-
* @dev: PCI device to operate on
892-
*
893-
* Undoes the allocations and enabling in pci_alloc_irq_vectors().
894-
*/
895-
void pci_free_irq_vectors(struct pci_dev *dev)
896-
{
897-
pci_disable_msix(dev);
898-
pci_disable_msi(dev);
899-
}
900-
EXPORT_SYMBOL(pci_free_irq_vectors);
901-
902889
/**
903890
* pci_irq_get_affinity - return the affinity of a particular MSI vector
904891
* @dev: PCI device to operate on

0 commit comments

Comments
 (0)