Unverified Commit 39a79978 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

[Backport release-24.11] xpadneo: fix build issues for kernel 6.12 (#359173)

parents 05b3ece0 b85e22dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ stdenv.mkDerivation (finalAttrs: {
    export sourceRoot=$(pwd)/${finalAttrs.src.name}/hid-xpadneo/src
  '';

  patches = [ ./xpadneo-0.9.6-kernel-6.12.patch ];

  nativeBuildInputs = kernel.moduleBuildDependencies;
  buildInputs = [ bluez ];

+20 −0
Original line number Diff line number Diff line
--- a/hid-xpadneo.c
+++ b/hid-xpadneo.c
@@ -713,5 +713,9 @@
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0)
 static u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *rsize)
+#else
+static const u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *rsize)
+#endif
 {
 	struct xpadneo_devdata *xdata = hid_get_drvdata(hdev);
--- a/xpadneo.h
+++ b/xpadneo.h
@@ -13,4 +13,5 @@
 
 #include <linux/hid.h>
+#include <linux/version.h>
 
 #include "hid-ids.h"