mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
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
(cherry picked from commit 2e3d9e2ad27ffc6743ad1f0bca06b9a802182a7a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499752
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
5e815ff501
commit
5c780b2c63
@@ -3,7 +3,7 @@
|
||||
* NVIDIA Tegra DRM GEM helper functions
|
||||
*
|
||||
* Copyright (C) 2012 Sascha Hauer, Pengutronix
|
||||
* Copyright (C) 2013-2023 NVIDIA CORPORATION, All rights reserved.
|
||||
* Copyright (C) 2013-2024 NVIDIA CORPORATION, All rights reserved.
|
||||
*
|
||||
* Based on the GEM/CMA helpers
|
||||
*
|
||||
@@ -24,7 +24,11 @@
|
||||
#include "drm.h"
|
||||
#include "gem.h"
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
|
||||
static unsigned int sg_dma_count_chunks(struct scatterlist *sgl, unsigned int nents)
|
||||
{
|
||||
|
||||
@@ -1762,6 +1762,10 @@ static void __exit capture_vi_exit(void)
|
||||
module_init(capture_vi_init);
|
||||
module_exit(capture_vi_exit);
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
MODULE_DESCRIPTION("tegra fusa-capture driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
|
||||
#include "mods_internal.h"
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
|
||||
static struct device *dummy_device;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
#define pr_fmt(fmt) "nvscic2c-pcie: vmap-pin: " fmt
|
||||
|
||||
@@ -380,4 +380,8 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
|
||||
@@ -489,7 +489,11 @@ static struct platform_driver fsicom_client = {
|
||||
|
||||
module_platform_driver(fsicom_client);
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
MODULE_DESCRIPTION("FSI-CCPLEX-COM driver");
|
||||
MODULE_AUTHOR("Prashant Shaw <pshaw@nvidia.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1589,6 +1589,10 @@ static void __exit nvdla_exit(void)
|
||||
module_exit(nvdla_exit);
|
||||
#endif
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
MODULE_AUTHOR("Shridhar Rasal <srasal@nvidia.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1800,5 +1800,9 @@ static void __exit nvpva_exit(void)
|
||||
module_exit(nvpva_exit);
|
||||
#endif
|
||||
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1068,7 +1068,11 @@ static void __exit nvmap_exit_driver(void)
|
||||
nvmap_dev = NULL;
|
||||
}
|
||||
module_exit(nvmap_exit_driver);
|
||||
#if defined(NV_MODULE_IMPORT_NS_CALLS_STRINGIFY)
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
#else
|
||||
MODULE_IMPORT_NS("DMA_BUF");
|
||||
#endif
|
||||
MODULE_DESCRIPTION("NvMap: Nvidia Tegra Memory Management Driver");
|
||||
MODULE_AUTHOR("Puneet Saxena <puneets@nvidia.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -149,6 +149,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += media_entity_remote_pad
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mm_struct_struct_has_percpu_counter_rss_stat
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_read_c45
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_write_c45
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += module_import_ns_calls_stringify
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += no_llseek
|
||||
|
||||
@@ -7619,6 +7619,24 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_MM_STRUCT_STRUCT_HAS_PERCPU_COUNTER_RSS_STAT" "" "types"
|
||||
;;
|
||||
|
||||
module_import_ns_calls_stringify)
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
CODE="
|
||||
#include <linux/module.h>
|
||||
MODULE_IMPORT_NS(DMA_BUF);
|
||||
"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_MODULE_IMPORT_NS_CALLS_STRINGIFY" "" "types"
|
||||
;;
|
||||
|
||||
no_llseek)
|
||||
#
|
||||
# Determine if the function no_llseek() is present.
|
||||
|
||||
Reference in New Issue
Block a user