mirror of
https://github.com/sysprog21/lkmpg.git
synced 2025-04-24 05:24:06 +08:00
Merge pull request #304 from EricccTaiwan/master
Drop .owner for kernel >= 6.4
This commit is contained in:
commit
7f4bca9ad5
@ -81,7 +81,9 @@ static ssize_t device_write(struct file *file, const char __user *buffer,
|
||||
}
|
||||
|
||||
static struct file_operations fops = {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
|
||||
.owner = THIS_MODULE,
|
||||
#endif
|
||||
.write = device_write,
|
||||
.open = device_open,
|
||||
.release = device_release,
|
||||
@ -112,7 +114,9 @@ static int __init led_init(void)
|
||||
MINOR(led_device.dev_num));
|
||||
|
||||
/* Prevents module unloading while operations are in use */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
|
||||
led_device.cdev.owner = THIS_MODULE;
|
||||
#endif
|
||||
|
||||
cdev_init(&led_device.cdev, &fops);
|
||||
ret = cdev_add(&led_device.cdev, led_device.dev_num, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user