From 9cedfe8b9ffb061d20c5dc756ee8a18fe56e44c3 Mon Sep 17 00:00:00 2001 From: areg Date: Wed, 30 Apr 2025 18:34:48 -0400 Subject: [PATCH] Support new and old kernels Header 'unaligned.h' is under 'asm/' until kernel version 6.12, which is moved to 'linux/' subsequently. --- driver/ch343.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/driver/ch343.c b/driver/ch343.c index f6c6125..fbca00b 100644 --- a/driver/ch343.c +++ b/driver/ch343.c @@ -58,7 +58,13 @@ #include #include #include + +// Support old and new kernel versions. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) +#include +#else #include +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) #include