From 26c45915c47c6715204da5877f372be7db4844bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Partheym=C3=BCller?= Date: Wed, 5 Jul 2023 10:58:25 +0200 Subject: [PATCH] linuxPackages.ax99100: Fix build with Linux 6.4 --- pkgs/os-specific/linux/ax99100/default.nix | 1 + .../ax99100/kernel-6.4-fix-define-semaphore.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/os-specific/linux/ax99100/kernel-6.4-fix-define-semaphore.patch diff --git a/pkgs/os-specific/linux/ax99100/default.nix b/pkgs/os-specific/linux/ax99100/default.nix index 9ff6add9fe9e..503532738564 100644 --- a/pkgs/os-specific/linux/ax99100/default.nix +++ b/pkgs/os-specific/linux/ax99100/default.nix @@ -28,6 +28,7 @@ stdenv.mkDerivation ./kernel-6.1-set_termios-const-ktermios.patch ] ++ (lib.optional (lib.versionAtLeast kernel.version "6.2") [ ./kernel-6.2-fix-pointer-type.patch + ./kernel-6.4-fix-define-semaphore.patch ]); patchFlags = [ "-p0" ]; diff --git a/pkgs/os-specific/linux/ax99100/kernel-6.4-fix-define-semaphore.patch b/pkgs/os-specific/linux/ax99100/kernel-6.4-fix-define-semaphore.patch new file mode 100644 index 000000000000..434bb559e177 --- /dev/null +++ b/pkgs/os-specific/linux/ax99100/kernel-6.4-fix-define-semaphore.patch @@ -0,0 +1,14 @@ +--- ax99100_sp.c ++++ ax99100_sp.c +@@ -2670,8 +2670,10 @@ static void serial99100_dma_tx_tasklet (unsigned long param) + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) + static DECLARE_MUTEX(serial99100_sem); +-#else ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0) + static DEFINE_SEMAPHORE(serial99100_sem); ++#else ++static DEFINE_SEMAPHORE(serial99100_sem, 1); + #endif + + static struct uart_driver starex_serial_driver = {