PCI: Move pci_iomap.c to drivers/pci/
authorPhilipp Stanner <pstanner@redhat.com>
Wed, 31 Jan 2024 09:00:21 +0000 (10:00 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 12 Feb 2024 16:35:40 +0000 (10:35 -0600)
The entirety of pci_iomap.c is guarded by an #ifdef CONFIG_PCI. It,
consequently, does not belong to lib/ because it is not generic
infrastructure.

Move pci_iomap.c to drivers/pci/ and implement the necessary changes to
Makefiles and Kconfigs.

Update MAINTAINERS file.

Update Documentation.

Link: https://lore.kernel.org/r/20240131090023.12331-3-pstanner@redhat.com
[bhelgaas: squash in https://lore.kernel.org/r/20240212150934.24559-1-pstanner@redhat.com]
Suggested-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Documentation/driver-api/device-io.rst
Documentation/driver-api/pci/pci.rst
MAINTAINERS
drivers/pci/Kconfig
drivers/pci/Makefile
drivers/pci/iomap.c [moved from lib/pci_iomap.c with 99% similarity]
lib/Kconfig
lib/Makefile

index d55384b106bd4ef7e4c41b77ea58624dbda88688..5c7e8194bef92bcb5c3c807852a3b21b04337728 100644 (file)
@@ -517,6 +517,3 @@ Public Functions Provided
 
 .. kernel-doc:: arch/x86/include/asm/io.h
    :internal:
-
-.. kernel-doc:: lib/pci_iomap.c
-   :export:
index 4843cfad4f60bb43a189fbe0da135b9241c4bff3..bacf23bf13433bf7d677365e7dd455b231723319 100644 (file)
@@ -4,6 +4,9 @@ PCI Support Library
 .. kernel-doc:: drivers/pci/pci.c
    :export:
 
+.. kernel-doc:: drivers/pci/iomap.c
+   :export:
+
 .. kernel-doc:: drivers/pci/pci-driver.c
    :export:
 
index 8d1052fa6a6924d17a4d2681fa7907c544e35186..395fcaad63e7e77aa6ffbd52eeb760e39efea1b2 100644 (file)
@@ -16954,7 +16954,6 @@ F:      include/asm-generic/pci*
 F:     include/linux/of_pci.h
 F:     include/linux/pci*
 F:     include/uapi/linux/pci*
-F:     lib/pci*
 
 PCIE DRIVER FOR AMAZON ANNAPURNA LABS
 M:     Jonathan Chocron <jonnyc@amazon.com>
index 74147262625bc2f899928feeaf643ea5f9f7fcd7..d35001589d88f85a56541d20b6ba4dd7088d2138 100644 (file)
@@ -13,6 +13,11 @@ config FORCE_PCI
        select HAVE_PCI
        select PCI
 
+# select this to provide a generic PCI iomap,
+# without PCI itself having to be defined
+config GENERIC_PCI_IOMAP
+       bool
+
 menuconfig PCI
        bool "PCI support"
        depends on HAVE_PCI
index cc8b4e01e29de5439c1671896d5dd53f77a3b9c4..64dcedccfc87b496a31f7ed58804495c4f497088 100644 (file)
@@ -14,6 +14,7 @@ ifdef CONFIG_PCI
 obj-$(CONFIG_PROC_FS)          += proc.o
 obj-$(CONFIG_SYSFS)            += slot.o
 obj-$(CONFIG_ACPI)             += pci-acpi.o
+obj-$(CONFIG_GENERIC_PCI_IOMAP) += iomap.o
 endif
 
 obj-$(CONFIG_OF)               += of.o
similarity index 99%
rename from lib/pci_iomap.c
rename to drivers/pci/iomap.c
index 2829ddb0e316b4d300bdae37d0c82e4f2882bd35..c9725428e3874ffd0a7ee6baac1299ba270f5457 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/export.h>
 
-#ifdef CONFIG_PCI
 /**
  * pci_iomap_range - create a virtual mapping cookie for a PCI BAR
  * @dev: PCI device that owns the BAR
@@ -176,5 +175,3 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p)
 EXPORT_SYMBOL(pci_iounmap);
 
 #endif /* ARCH_WANTS_GENERIC_PCI_IOUNMAP */
-
-#endif /* CONFIG_PCI */
index 5ddda7c2ed9b3387375fa54ecec6b539f921d951..4557bb8a5256516e95019a5dc683d1e0617749aa 100644 (file)
@@ -70,9 +70,6 @@ source "lib/math/Kconfig"
 config NO_GENERIC_PCI_IOPORT_MAP
        bool
 
-config GENERIC_PCI_IOMAP
-       bool
-
 config GENERIC_IOMAP
        bool
        select GENERIC_PCI_IOMAP
index 6b09731d8e6195603aab99a3fd3f5dc56331f567..0800289ec6c52e78530cc59c5ab414d007d74749 100644 (file)
@@ -153,7 +153,6 @@ CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any)
 obj-y += math/ crypto/
 
 obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
-obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o
 obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o