nixpkgs/pkgs/os-specific/linux/ch9344/fix-linux-6-12-build.patch
MakiseKurisu c353ff9402
ch9344: 2.0 -> 0-unstable-2024-11-15
GitHub repository does not contain versioned tags. The version mentioned
in the commit message also does not match the change log embedded in the
source code, which seems to be where the official version came from.

Since this is such a mess, treat the package as no versioning.
2024-12-04 13:16:07 +08:00

17 lines
408 B
Diff

diff --git a/ch9344.c b/ch9344.c
index 8130334..b017faa 100644
--- a/ch9344.c
+++ b/ch9344.c
@@ -62,7 +62,11 @@
#include <linux/timer.h>
#include <linux/kfifo.h>
#include <asm/byteorder.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#include <linux/unaligned.h>
+#else
#include <asm/unaligned.h>
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
#include <linux/sched/signal.h>