diff mbox series

[1/1] package/dahdi-linux: Fix build on Linux 6.4

Message ID 20230709151919.1694148-1-bernd@kuhls.net
State Accepted
Headers show
Series [1/1] package/dahdi-linux: Fix build on Linux 6.4 | expand

Commit Message

Bernd Kuhls July 9, 2023, 3:19 p.m. UTC
Fixes:
http://autobuild.buildroot.net/results/8b1/8b140b7f4d2f2b3080cab90906c3cebea0e510c5/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 .../0006-Fix-build-on-Linux-6.4.patch         | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 package/dahdi-linux/0006-Fix-build-on-Linux-6.4.patch

Comments

Thomas Petazzoni July 9, 2023, 4:32 p.m. UTC | #1
On Sun,  9 Jul 2023 17:19:19 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> Fixes:
> http://autobuild.buildroot.net/results/8b1/8b140b7f4d2f2b3080cab90906c3cebea0e510c5/
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
>  .../0006-Fix-build-on-Linux-6.4.patch         | 69 +++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 package/dahdi-linux/0006-Fix-build-on-Linux-6.4.patch

Applied to master, thanks.

Thomas
diff mbox series

Patch

diff --git a/package/dahdi-linux/0006-Fix-build-on-Linux-6.4.patch b/package/dahdi-linux/0006-Fix-build-on-Linux-6.4.patch
new file mode 100644
index 0000000000..992cb4d513
--- /dev/null
+++ b/package/dahdi-linux/0006-Fix-build-on-Linux-6.4.patch
@@ -0,0 +1,69 @@ 
+From b393e59d7eb2951e2fb279fca1c4756ea165aeee Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Sun, 9 Jul 2023 17:14:31 +0200
+Subject: [PATCH] Fix build on Linux 6.4
+
+Needed after upstream changes in kernel 6.4:
+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/include/linux/device/class.h?id=1aaba11da9aa
+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=48380368dec14859723b9e3fbd43e042638d9a76
+
+Upstream: https://github.com/asterisk/dahdi-linux/pull/22
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ drivers/dahdi/dahdi-sysfs-chan.c  | 4 ++++
+ drivers/dahdi/voicebus/voicebus.c | 4 ++++
+ drivers/dahdi/wctdm24xxp/base.c   | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/drivers/dahdi/dahdi-sysfs-chan.c b/drivers/dahdi/dahdi-sysfs-chan.c
+index a91e6ed..b18b5f9 100644
+--- a/drivers/dahdi/dahdi-sysfs-chan.c
++++ b/drivers/dahdi/dahdi-sysfs-chan.c
+@@ -482,7 +482,11 @@ int __init dahdi_sysfs_chan_init(const struct file_operations *fops)
+ 	}
+ 	should_cleanup.channel_driver = 1;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
+ 	dahdi_class = class_create(THIS_MODULE, "dahdi");
++#else
++	dahdi_class = class_create("dahdi");
++#endif
+ 	if (IS_ERR(dahdi_class)) {
+ 		res = PTR_ERR(dahdi_class);
+ 		dahdi_err("%s: class_create(dahi_chan) failed. Error: %d\n",
+diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c
+index 8a1f7a6..d141aaf 100644
+--- a/drivers/dahdi/voicebus/voicebus.c
++++ b/drivers/dahdi/voicebus/voicebus.c
+@@ -1135,7 +1135,11 @@ static void vb_stop_txrx_processors(struct voicebus *vb)
+  */
+ void voicebus_stop(struct voicebus *vb)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
+ 	static DEFINE_SEMAPHORE(stop);
++#else
++	static DEFINE_SEMAPHORE(stop, 1);
++#endif
+ 
+ 	down(&stop);
+ 
+diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
+index a28e249..4392b45 100644
+--- a/drivers/dahdi/wctdm24xxp/base.c
++++ b/drivers/dahdi/wctdm24xxp/base.c
+@@ -224,7 +224,11 @@ mod_hooksig(struct wctdm *wc, struct wctdm_module *mod, enum dahdi_rxsig rxsig)
+ }
+ 
+ struct wctdm *ifaces[WC_MAX_IFACES];
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
+ DEFINE_SEMAPHORE(ifacelock);
++#else
++DEFINE_SEMAPHORE(ifacelock, 1);
++#endif
+ 
+ static void wctdm_release(struct wctdm *wc);
+ 
+-- 
+2.39.2
+