On Tue, Nov 21, 2023, at 15:38, Philipp Stanner wrote: > On Tue, 2023-11-21 at 11:03 +0100, Arnd Bergmann wrote: >> On Mon, Nov 20, 2023, at 22:59, Philipp Stanner wrote: >> We should be able to define a generic version like >> >> void pci_iounmap(struct pci_dev *dev, void __iomem * addr) >> { >> #ifdef CONFIG_HAS_IOPORT >> if (iomem_is_ioport(addr)) { >> ioport_unmap(addr); >> return; >> } >> #endif >> iounmap(addr) >> } > > And where would you like such a function to reside? > drivers/pci/iomap.c? Yes, I think that would be the logical place. It could also be an inline function but that's not great on architectures that don't also have iomem_is_ioport() inline. Arnd