drivers: Fix MODULE_IMPORT_NS for Linux v6.13

In Linux v6.13, commit cdd30ebb1b9f ("module: Convert symbol namespace
to string literal") updated the MODULE_IMPORT_NS macro to take a string
literal as an argument in Linux v6.13. Use conftest to detect if
MODULE_IMPORT_NS takes a string literal as an argument and update the
various drivers accordingly.

Bug 4991705

Change-Id: I8f34860648965dc2334e2916d5404522510778ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263798
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-12-04 13:07:10 +00:00
parent 66ddf2ba6f
commit ff48ee63b1
11 changed files with 49 additions and 9 deletions

View File

@@ -7633,18 +7633,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_MII_BUS_STRUCT_HAS_WRITE_C45" "" "types"
;;
module_import_ns_macro)
module_import_ns_calls_stringify)
#
# Determine if the MODULE_IMPORT_NS macro present.
# Determine if the MODULE_IMPORT_NS macro takes a string literal as
# an argument.
#
# Commit cdd30ebb1b9f ("module: Convert symbol namespace to string
# literal") updated the symbol namespace macros to take a string
# literal as an argument and removes the call to __stringify from
# within the macro for Linux v6.13.
#
# Added in commit 80140a81f7f833 ("module.h: simplify MODULE_IMPORT_NS")
# in Linux 5.18.
CODE="
#include <linux/module.h>
MODULE_IMPORT_NS(DMA_BUF);
"
compile_check_conftest "$CODE" "NV_MODULE_IMPORT_NS_PRESENT" "" "types"
compile_check_conftest "$CODE" "NV_MODULE_IMPORT_NS_CALLS_STRINGIFY" "" "types"
;;
no_llseek)