aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/cyber_device_device_class.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1edf32e..06169a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-03-12 Felix Morgner <felix.morgner@gmail.com>
+
+ * cyber device class: fix compilation on Linux >= 6.2.0
+
2017-10-26 Felix Morgner <felix.morgner@gmail.com>
* cyber device class: switch to newer Linux device class API
diff --git a/src/cyber_device_device_class.c b/src/cyber_device_device_class.c
index 98e9557..0ceeaac 100644
--- a/src/cyber_device_device_class.c
+++ b/src/cyber_device_device_class.c
@@ -22,6 +22,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
+#include <linux/version.h>
extern struct cyber_device device;
@@ -37,7 +38,11 @@ static ssize_t storage_technology_show(struct class * class, struct class_attrib
}
static CLASS_ATTR_RO(storage_technology);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0)
+static int cyber_device_handle_uevent(struct device const * kernelDevice, struct kobj_uevent_env * environment)
+#else
static int cyber_device_handle_uevent(struct device * kernelDevice, struct kobj_uevent_env * environment)
+#endif
{
add_uevent_var(environment, "DEVMODE=%#o", 0666);
return 0;