Skip to content

Commit 7f4bca9

Browse files
authored
Merge pull request #304 from EricccTaiwan/master
Drop .owner for kernel >= 6.4
2 parents 26988ef + 2b22c6b commit 7f4bca9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/led.c

+4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ static ssize_t device_write(struct file *file, const char __user *buffer,
8181
}
8282

8383
static struct file_operations fops = {
84+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
8485
.owner = THIS_MODULE,
86+
#endif
8587
.write = device_write,
8688
.open = device_open,
8789
.release = device_release,
@@ -112,7 +114,9 @@ static int __init led_init(void)
112114
MINOR(led_device.dev_num));
113115

114116
/* Prevents module unloading while operations are in use */
117+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
115118
led_device.cdev.owner = THIS_MODULE;
119+
#endif
116120

117121
cdev_init(&led_device.cdev, &fops);
118122
ret = cdev_add(&led_device.cdev, led_device.dev_num, 1);

0 commit comments

Comments
 (0)