mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
misc: Drop THIS_MODULE from class create for Linux 6.6
THIS_MODULE is dropped from Linux6.6. Removing this via conftest. Bug 4346767 Change-Id: I01a03b6ce6daeb1715fd06d3f6c4a2507f1a441c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3008088 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
1cae6bd4d7
commit
b8ed894279
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -53,7 +55,9 @@ static long device_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
}
|
||||
|
||||
static struct file_operations fops = {
|
||||
#if !defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG)
|
||||
.owner = THIS_MODULE,
|
||||
#endif
|
||||
.open = device_open,
|
||||
.release = device_release,
|
||||
.unlocked_ioctl = device_ioctl,
|
||||
@@ -69,7 +73,12 @@ static int __init ioctl_example_init(void)
|
||||
cdev_add(&cdev, dev_num, 1);
|
||||
|
||||
/* Create a device class */
|
||||
|
||||
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG)
|
||||
dev_class = class_create("ioctl_example");
|
||||
#else
|
||||
dev_class = class_create(THIS_MODULE, "ioctl_example");
|
||||
#endif
|
||||
device_create(dev_class, NULL, dev_num, NULL, "ioctl_example");
|
||||
|
||||
pr_info("ioctl_example: Module loaded\n");
|
||||
|
||||
Reference in New Issue
Block a user