Skip to content

Commit 4a6afd6

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
PCI: Make pcim_iounmap_region() a public function
The function pcim_iounmap_regions() is problematic because it uses a bitmask mechanism to release / iounmap multiple BARs at once. It, thus, prevents getting rid of the problematic iomap table mechanism which was deprecated in commit e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). pcim_iounmap_region() does not have that problem. Make it public as the successor of pcim_iounmap_regions(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 6d9c592 commit 4a6afd6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/pci/devres.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ EXPORT_SYMBOL(pcim_iomap_region);
773773
* Unmap a BAR and release its region manually. Only pass BARs that were
774774
* previously mapped by pcim_iomap_region().
775775
*/
776-
static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
776+
void pcim_iounmap_region(struct pci_dev *pdev, int bar)
777777
{
778778
struct pcim_addr_devres res_searched;
779779

@@ -784,6 +784,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
784784
devres_release(&pdev->dev, pcim_addr_resource_release,
785785
pcim_addr_resources_match, &res_searched);
786786
}
787+
EXPORT_SYMBOL(pcim_iounmap_region);
787788

788789
/**
789790
* pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED)

include/linux/pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,6 +2297,7 @@ int pcim_request_all_regions(struct pci_dev *pdev, const char *name);
22972297
void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
22982298
void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar,
22992299
const char *name);
2300+
void pcim_iounmap_region(struct pci_dev *pdev, int bar);
23002301
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
23012302
void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
23022303
int pcim_request_region(struct pci_dev *pdev, int bar, const char *name);

0 commit comments

Comments
 (0)