mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: Use conftest test for class_create
A test has already been added to the conftest script for checking if the class_create() function has a module pointer argument or not. So use the definition generated by conftest to select which version of the function to use. Bug 4221847 Bug 4276500 Change-Id: If4b4445b2dfb2ec6556ca8c4ef9931e6b8833357 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3015846 (cherry picked from commit cf745fa6d89a277dc8fb72454b9a7d26454e8b8d) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3017318 Reviewed-by: Sagar Kamble <skamble@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7a5b01c4af
commit
41e6fae71e
@@ -438,10 +438,10 @@ static struct nvgpu_class *nvgpu_create_class(struct gk20a *g, const char *class
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
class->class = class_create(THIS_MODULE, class_name);
|
|
||||||
#else
|
|
||||||
class->class = class_create(class_name);
|
class->class = class_create(class_name);
|
||||||
|
#else
|
||||||
|
class->class = class_create(THIS_MODULE, class_name);
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(class->class)) {
|
if (IS_ERR(class->class)) {
|
||||||
nvgpu_err(g, "failed to create class");
|
nvgpu_err(g, "failed to create class");
|
||||||
|
|||||||
Reference in New Issue
Block a user