From 96dd1cf2eeac5b242fb7104ffc2159b5052579a7 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Fri, 18 Oct 2024 02:58:20 +0000 Subject: [PATCH] memory: use conftest test for class_create In Linux v6.4, the module pointer argument is removed from the class_create() function. Add a test to the conftest script that checks if this argument for the class_create() function has been removed and use the definition created by conftest to select which version of the function is used. Bug 4183168 Bug 4221847 Change-Id: Ic1aef0216eae64b32273dc085b8b8306d1235d9b Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234808 GVS: buildbot_gerritrpt --- drivers/memory/tegra/private-soc/mem-qual.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/memory/tegra/private-soc/mem-qual.c b/drivers/memory/tegra/private-soc/mem-qual.c index b5998365..4d9b47ed 100644 --- a/drivers/memory/tegra/private-soc/mem-qual.c +++ b/drivers/memory/tegra/private-soc/mem-qual.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only /* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ +#include + #define pr_fmt(fmt) "tegra264-mem-qual: " fmt #include #include @@ -292,7 +294,7 @@ static int __init tegra_mem_qual_init(void) dev_num = 0; device_index = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) +#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */ class = class_create("qual_class"); #else class = class_create(THIS_MODULE, "qual_class");