|
7 | 7 | #include <linux/module.h>
|
8 | 8 | #include <linux/slab.h>
|
9 | 9 | #include <linux/spinlock.h>
|
| 10 | +#include <linux/version.h> |
10 | 11 |
|
11 | 12 | #include <asm/uaccess.h>
|
12 | 13 |
|
@@ -132,7 +133,9 @@ static ssize_t vinput_write(struct file *file, const char __user *buffer,
|
132 | 133 | }
|
133 | 134 |
|
134 | 135 | static const struct file_operations vinput_fops = {
|
| 136 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) |
135 | 137 | .owner = THIS_MODULE,
|
| 138 | +#endif |
136 | 139 | .open = vinput_open,
|
137 | 140 | .release = vinput_release,
|
138 | 141 | .read = vinput_read,
|
@@ -240,7 +243,12 @@ static int vinput_register_vdevice(struct vinput *vinput)
|
240 | 243 | return err;
|
241 | 244 | }
|
242 | 245 |
|
| 246 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) |
| 247 | +static ssize_t export_store(const struct class *class, |
| 248 | + const struct class_attribute *attr, |
| 249 | +#else |
243 | 250 | static ssize_t export_store(struct class *class, struct class_attribute *attr,
|
| 251 | +#endif |
244 | 252 | const char *buf, size_t len)
|
245 | 253 | {
|
246 | 254 | int err;
|
@@ -281,7 +289,12 @@ static ssize_t export_store(struct class *class, struct class_attribute *attr,
|
281 | 289 | /* This macro generates class_attr_export structure and export_store() */
|
282 | 290 | static CLASS_ATTR_WO(export);
|
283 | 291 |
|
| 292 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) |
| 293 | +static ssize_t unexport_store(const struct class *class, |
| 294 | + const struct class_attribute *attr, |
| 295 | +#else |
284 | 296 | static ssize_t unexport_store(struct class *class, struct class_attribute *attr,
|
| 297 | +#endif |
285 | 298 | const char *buf, size_t len)
|
286 | 299 | {
|
287 | 300 | int err;
|
@@ -322,7 +335,9 @@ ATTRIBUTE_GROUPS(vinput_class);
|
322 | 335 |
|
323 | 336 | static struct class vinput_class = {
|
324 | 337 | .name = "vinput",
|
| 338 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) |
325 | 339 | .owner = THIS_MODULE,
|
| 340 | +#endif |
326 | 341 | .class_groups = vinput_class_groups,
|
327 | 342 | };
|
328 | 343 |
|
|
0 commit comments