From 0fa5fc1583e626065728a7df133c25c75a3fdadd Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 27 Sep 2023 11:57:54 +0100 Subject: [PATCH] gpu: nvgpu: 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. The MODULE_IMPORT_NS macro was introduced in Linux v5.4 and so if the kernel defines this, then add the DMA_BUF namespace. Bug 4119327 Change-Id: Ic9acfeedce3a783434fe9cc2ded788c522629bbd Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2986636 (cherry picked from commit fd8ed471078450172062ca2a11f13d99ad57e1cb) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2990695 Reviewed-by: Ankur Kishore GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 4c20202bd..58deeaade 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -2102,7 +2102,7 @@ static void __exit gk20a_exit(void) platform_driver_unregister(&gk20a_driver); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#ifdef MODULE_IMPORT_NS MODULE_IMPORT_NS(DMA_BUF); #endif #ifdef CONFIG_GK20A_DEVFREQ