From 8ccb04055320ac6aba81bf7e2feeb0de455feb53 Mon Sep 17 00:00:00 2001 From: Cheng-Yang Chou Date: Tue, 15 Apr 2025 02:44:26 +0800 Subject: [PATCH] Drop .owner for kernel >= 6.4 Kernel 6.4+ sets .owner automatically. Remove manual assignment to avoid build issues and keep compatibility with older versions. --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 731cefa..89df94e 100644 --- a/main.c +++ b/main.c @@ -440,11 +440,13 @@ static int kxo_release(struct inode *inode, struct file *filp) } static const struct file_operations kxo_fops = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) + .owner = THIS_MODULE, +#endif .read = kxo_read, .llseek = no_llseek, .open = kxo_open, .release = kxo_release, - .owner = THIS_MODULE, }; static int __init kxo_init(void)