generic: mtdsplit: include appropriate header for kernel 6.12
authorMieczyslaw Nalewaj <[email protected]>
Tue, 15 Apr 2025 18:03:04 +0000 (20:03 +0200)
committerChristian Marangi <[email protected]>
Wed, 30 Apr 2025 14:26:46 +0000 (16:26 +0200)
In kernel 6.12 asm/unaligned.h was moved to linux/unaligned.h[1]
The patch points to the appropriate header depending on the kernel version.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=5f60d5f6bbc12e782fac78110b0ee62698f3b576

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16547
Signed-off-by: Christian Marangi <[email protected]>
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c

index c58f7ae4bf066bd08f7c1e972875e7ac6c63e7e4..6dcffd04203da6acda2ddbd58543740a50c4fbad 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/of.h>
+#include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0)
 #include <asm/unaligned.h>
+#else
+#include <linux/unaligned.h>
+#endif
 
 #include "mtdsplit.h"