From 5d9f20541fc3871ce235a3704ec7d80e5226f154 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 12 Mar 2023 20:30:32 +0100 Subject: device_class: fix compilation for Linux >= 6.2.0 --- src/cyber_device_device_class.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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 #include #include +#include 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; -- cgit v1.2.3