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 <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234808
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2024-10-18 02:58:20 +00:00
committed by Jon Hunter
parent 01b31bbabb
commit 96dd1cf2ee

View File

@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-only
/* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
#include <nvidia/conftest.h>
#define pr_fmt(fmt) "tegra264-mem-qual: " fmt
#include <linux/kernel.h>
#include <linux/module.h>
@@ -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");