From 13836ea146c155809786ea16315efb0db52c8404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Partheym=C3=BCller?= Date: Thu, 27 Apr 2023 16:13:43 +0200 Subject: [PATCH] linuxPackages.ax99100: fix build with Linux >= 6.2 --- pkgs/os-specific/linux/ax99100/default.nix | 4 +++- .../linux/ax99100/kernel-6.2-fix-pointer-type.patch | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/ax99100/kernel-6.2-fix-pointer-type.patch diff --git a/pkgs/os-specific/linux/ax99100/default.nix b/pkgs/os-specific/linux/ax99100/default.nix index 600e02de7074..9ff6add9fe9e 100644 --- a/pkgs/os-specific/linux/ax99100/default.nix +++ b/pkgs/os-specific/linux/ax99100/default.nix @@ -26,7 +26,9 @@ stdenv.mkDerivation patches = [ ./kernel-5.18-pci_free_consistent-pci_alloc_consistent.patch ./kernel-6.1-set_termios-const-ktermios.patch - ]; + ] ++ (lib.optional (lib.versionAtLeast kernel.version "6.2") [ + ./kernel-6.2-fix-pointer-type.patch + ]); patchFlags = [ "-p0" ]; diff --git a/pkgs/os-specific/linux/ax99100/kernel-6.2-fix-pointer-type.patch b/pkgs/os-specific/linux/ax99100/kernel-6.2-fix-pointer-type.patch new file mode 100644 index 000000000000..39071f2f4798 --- /dev/null +++ b/pkgs/os-specific/linux/ax99100/kernel-6.2-fix-pointer-type.patch @@ -0,0 +1,11 @@ +--- ax99100_spi.c ++++ ax99100_spi.c +@@ -76,7 +76,7 @@ int spi_suspend_count; + static unsigned int spi_major = 241; + static unsigned int spi_min_count = 0; + /* device Class */ +-static char *ax_devnode(struct device *dev, umode_t *mode) ++static char *ax_devnode(const struct device *dev, umode_t *mode) + { + return kasprintf(GFP_KERNEL, "%s", dev_name(dev)); + }