Fix unaligned.h header for good

Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
This commit is contained in:
Aleksa Savic
2025-01-19 16:52:01 +01:00
parent 047bfb1059
commit 1c65e84bfa
3 changed files with 9 additions and 6 deletions

View File

@@ -13,7 +13,7 @@
with:
repository: torvalds/linux
path: ./linux
ref: v6.4
ref: v6.12
- name: install libelf-dev
run: |
sudo apt update

View File

@@ -132,10 +132,6 @@ available! Refer to the table in the overview above to check.
If you're not, or your kernel does not have the driver support for your particular device, you can compile it yourself.
### Kernel 6.12 or later
The `asm/unaligned.h` include is moved to `linux/unaligned.h`. Modify it to get it to compile on ealier versions.
### Kernel 5.18 and later
The driver uses some features only available in kernel 5.18 and later. You can check your kernel version by running:

View File

@@ -12,6 +12,14 @@
* Copyright 2022 Jack Doan <me@jackdoan.com>
*/
#include <generated/uapi/linux/version.h>
#if KERNEL_VERSION(6, 12, 0) <= LINUX_VERSION_CODE
#include <linux/unaligned.h>
#else
#include <asm/unaligned.h>
#endif
#include <linux/crc16.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
@@ -24,7 +32,6 @@
#include <linux/mutex.h>
#include <linux/seq_file.h>
#include <linux/usb.h>
#include <linux/unaligned.h>
#define USB_VENDOR_ID_AQUACOMPUTER 0x0c70
#define USB_PRODUCT_ID_AQUAERO 0xf001