xr_usb_serial_common: fix build with linux 6.12

This commit is contained in:
coolsnowwolf 2024-12-23 14:03:11 +08:00
parent 01e5467f06
commit 0860b02840

View File

@ -0,0 +1,17 @@
--- a/xr_usb_serial_common-1a/xr_usb_serial_common.c
+++ b/xr_usb_serial_common-1a/xr_usb_serial_common.c
@@ -48,9 +48,13 @@
#include <linux/usb.h>
#include <linux/usb/cdc.h>
#include <asm/byteorder.h>
-#include <asm/unaligned.h>
#include <linux/list.h>
#include "linux/version.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+#include <linux/unaligned.h>
+#else
+#include <asm/unaligned.h>
+#endif
#include "xr_usb_serial_common.h"
#include "xr_usb_serial_ioctl.h"