From cdc64f43fa3564be23f9c5978107bcaed1afae28 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 12 Sep 2023 22:27:40 +0100 Subject: [PATCH] drivers: Drop version check for DMA BUF namespace The MODULE_IMPORT_NS macro adds a namespace tag to the module information. The DMA_BUF namespace is required for Linux v5.16+ kernels for drivers that use DMA BUF, there is no reason not to populate this for earlier kernels. Furthermore, some 3rd party kernels prior to v5.16 may require this too and so drop the version check around the DMA BUF namespace. Bug 4119327 Change-Id: If8a5e90340f7a0582247cb91611d275ec1f4990e Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979260 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/gem.c | 2 -- drivers/misc/mods/mods_dmabuf.c | 2 -- drivers/misc/nvscic2c-pcie/vmap-pin.c | 3 --- drivers/platform/tegra/tegra-fsicom.c | 3 --- drivers/video/tegra/host/nvdla/nvdla.c | 2 -- drivers/video/tegra/host/pva/pva.c | 2 -- drivers/video/tegra/nvmap/nvmap_init.c | 2 -- 7 files changed, 16 deletions(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index e7fa3eb9..0555e2d0 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -24,9 +24,7 @@ #include "drm.h" #include "gem.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) MODULE_IMPORT_NS(DMA_BUF); -#endif static unsigned int sg_dma_count_chunks(struct scatterlist *sgl, unsigned int nents) { diff --git a/drivers/misc/mods/mods_dmabuf.c b/drivers/misc/mods/mods_dmabuf.c index ca92cc8b..58fab6b9 100644 --- a/drivers/misc/mods/mods_dmabuf.c +++ b/drivers/misc/mods/mods_dmabuf.c @@ -8,9 +8,7 @@ #include "mods_internal.h" -#if KERNEL_VERSION(5, 4, 0) <= MODS_KERNEL_VERSION MODULE_IMPORT_NS(DMA_BUF); -#endif static struct device *dummy_device; diff --git a/drivers/misc/nvscic2c-pcie/vmap-pin.c b/drivers/misc/nvscic2c-pcie/vmap-pin.c index db8c8cda..c23016d4 100644 --- a/drivers/misc/nvscic2c-pcie/vmap-pin.c +++ b/drivers/misc/nvscic2c-pcie/vmap-pin.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include "common.h" @@ -381,6 +380,4 @@ err: return ret; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) MODULE_IMPORT_NS(DMA_BUF); -#endif diff --git a/drivers/platform/tegra/tegra-fsicom.c b/drivers/platform/tegra/tegra-fsicom.c index d6c243f1..ad79d65b 100644 --- a/drivers/platform/tegra/tegra-fsicom.c +++ b/drivers/platform/tegra/tegra-fsicom.c @@ -471,10 +471,7 @@ static struct platform_driver fsicom_client = { module_platform_driver(fsicom_client); -#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0) MODULE_IMPORT_NS(DMA_BUF); -#endif - MODULE_DESCRIPTION("FSI-CCPLEX-COM driver"); MODULE_AUTHOR("Prashant Shaw "); MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index 669a62f3..640bd4a6 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -1516,8 +1516,6 @@ static void __exit nvdla_exit(void) module_exit(nvdla_exit); #endif -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE MODULE_IMPORT_NS(DMA_BUF); -#endif MODULE_AUTHOR("Shridhar Rasal "); MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/tegra/host/pva/pva.c b/drivers/video/tegra/host/pva/pva.c index 27eb7023..50a4c871 100644 --- a/drivers/video/tegra/host/pva/pva.c +++ b/drivers/video/tegra/host/pva/pva.c @@ -1655,7 +1655,5 @@ static void __exit nvpva_exit(void) module_exit(nvpva_exit); #endif -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE MODULE_IMPORT_NS(DMA_BUF); -#endif MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/tegra/nvmap/nvmap_init.c b/drivers/video/tegra/nvmap/nvmap_init.c index 92285d4d..dd36eebd 100644 --- a/drivers/video/tegra/nvmap/nvmap_init.c +++ b/drivers/video/tegra/nvmap/nvmap_init.c @@ -1057,9 +1057,7 @@ static void __exit nvmap_exit_driver(void) nvmap_dev = NULL; } module_exit(nvmap_exit_driver); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) MODULE_IMPORT_NS(DMA_BUF); -#endif MODULE_DESCRIPTION("NvMap: Nvidia Tegra Memory Management Driver"); MODULE_AUTHOR("Puneet Saxena "); MODULE_LICENSE("GPL v2");