diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2023-03-12 20:30:32 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2023-03-12 20:30:32 +0100 |
| commit | 5d9f20541fc3871ce235a3704ec7d80e5226f154 (patch) | |
| tree | 3d92451a3f4b48b9cde1acc2000be8a950e8f6c3 | |
| parent | 6cda549fe2bce6a895df78aa59388861bb3a6fae (diff) | |
| download | dev-cyber-5d9f20541fc3871ce235a3704ec7d80e5226f154.tar.xz dev-cyber-5d9f20541fc3871ce235a3704ec7d80e5226f154.zip | |
device_class: fix compilation for Linux >= 6.2.0v42.1729.1906
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | src/cyber_device_device_class.c | 5 |
2 files changed, 9 insertions, 0 deletions
@@ -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; |
