Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions examples/dht11.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ static ssize_t device_read(struct file *filp, char __user *buffer,
}

static struct file_operations fops = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
.owner = THIS_MODULE,
#endif
.open = device_open,
.release = device_release,
.read = device_read
.read = device_read,
};

/* Initialize the module - Register the character device */
Expand Down Expand Up @@ -182,9 +180,7 @@ static int __init dht11_init(void)
MINOR(dht11_device.dev_num));

/* Prevents module unloading while operations are in use */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
dht11_device.cdev.owner = THIS_MODULE;
#endif

cdev_init(&dht11_device.cdev, &fops);
ret = cdev_add(&dht11_device.cdev, dht11_device.dev_num, 1);
Expand Down
2 changes: 0 additions & 2 deletions examples/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ static int test_ioctl_open(struct inode *inode, struct file *filp)
}

static struct file_operations fops = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
.owner = THIS_MODULE,
#endif
.open = test_ioctl_open,
.release = test_ioctl_close,
.read = test_ioctl_read,
Expand Down
2 changes: 0 additions & 2 deletions examples/static_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ static struct class *cls;
static DEFINE_STATIC_KEY_FALSE(fkey);

static struct file_operations chardev_fops = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
.owner = THIS_MODULE,
#endif
.open = device_open,
.release = device_release,
.read = device_read,
Expand Down
5 changes: 3 additions & 2 deletions examples/vinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ static ssize_t vinput_write(struct file *file, const char __user *buffer,
}

static const struct file_operations vinput_fops = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
.owner = THIS_MODULE,
#endif
.open = vinput_open,
.release = vinput_release,
.read = vinput_read,
Expand Down Expand Up @@ -337,6 +335,9 @@ ATTRIBUTE_GROUPS(vinput_class);

static struct class vinput_class = {
.name = "vinput",
/* .owner was removed in Linux v6.4 via upstream commit 6e30a66433af ("driver core: class: remove
* struct module owner out of struct class")
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
.owner = THIS_MODULE,
#endif
Expand Down