Skip to content

Commit 4613127

Browse files
Merge pull request #72 from donrudo/master
Fix new location of `unaligned.h` starting with kernel 6.12.
2 parents 7d859ee + dbb9279 commit 4613127

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

drivers/hwmon/nzxt-grid3.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@
3333
* Copyright 2019-2021 Jonas Malaco <[email protected]>
3434
*/
3535

36+
#include <generated/uapi/linux/version.h>
37+
38+
#if KERNEL_VERSION(6, 12, 0) <= LINUX_VERSION_CODE
39+
#include <linux/unaligned.h>
40+
#else
3641
#include <asm/unaligned.h>
42+
#endif
43+
3744
#include <linux/bitops.h>
3845
#include <linux/errno.h>
3946
#include <linux/hid.h>

drivers/hwmon/nzxt-kraken2.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
* Copyright 2019-2021 Jonas Malaco <[email protected]>
1010
*/
1111

12+
#include <generated/uapi/linux/version.h>
13+
14+
#if KERNEL_VERSION(6, 12, 0) <= LINUX_VERSION_CODE
15+
#include <linux/unaligned.h>
16+
#else
1217
#include <asm/unaligned.h>
18+
#endif
19+
1320
#include <linux/hid.h>
1421
#include <linux/hwmon.h>
1522
#include <linux/jiffies.h>

drivers/hwmon/nzxt-kraken3.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Copyright 2022 Aleksa Savic <[email protected]>
99
*/
1010

11+
#include <generated/uapi/linux/version.h>
12+
1113
#include <linux/debugfs.h>
1214
#include <linux/hid.h>
1315
#include <linux/hwmon.h>
@@ -17,7 +19,12 @@
1719
#include <linux/mutex.h>
1820
#include <linux/spinlock.h>
1921
#include <linux/wait.h>
22+
23+
#if KERNEL_VERSION(6, 12, 0) <= LINUX_VERSION_CODE
24+
#include <linux/unaligned.h>
25+
#else
2026
#include <asm/unaligned.h>
27+
#endif
2128

2229
#define USB_VENDOR_ID_NZXT 0x1e71
2330
#define USB_PRODUCT_ID_X53 0x2007

drivers/hwmon/nzxt-smart2.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@
55
* Copyright (c) 2021 Aleksandr Mezin
66
*/
77

8-
#include <linux/version.h>
8+
#include <generated/uapi/linux/version.h>
99

1010
#include <linux/hid.h>
1111
#include <linux/hwmon.h>
12-
#if KERNEL_VERSION(5, 11, 0) > LINUX_VERSION_CODE
13-
#include <linux/kernel.h>
14-
#else
12+
#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
1513
#include <linux/math.h>
14+
#else
15+
#include <linux/kernel.h>
1616
#endif
1717
#include <linux/module.h>
1818
#include <linux/mutex.h>
1919
#include <linux/spinlock.h>
2020
#include <linux/wait.h>
2121

2222
#include <asm/byteorder.h>
23+
24+
#if KERNEL_VERSION(6, 12, 0) <= LINUX_VERSION_CODE
25+
#include <linux/unaligned.h>
26+
#else
2327
#include <asm/unaligned.h>
28+
#endif
2429

2530
/*
2631
* The device has only 3 fan channels/connectors. But all HID reports have

0 commit comments

Comments
 (0)