Skip to content
Open
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
8 changes: 8 additions & 0 deletions nuc_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
Expand Down Expand Up @@ -443,11 +444,18 @@ static ssize_t acpi_proc_read(struct file *filp, char __user *buff,
return ret;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_acpi_operations = {
.proc_read = acpi_proc_read,
.proc_write = acpi_proc_write,
};
#else
static struct file_operations proc_acpi_operations = {
.owner = THIS_MODULE,
.read = acpi_proc_read,
.write = acpi_proc_write,
};
#endif

/* Init & unload */
static int __init init_nuc_led(void)
Expand Down