diff -uNra a/drivers/dahdi/dahdi-sysfs-chan.c b/drivers/dahdi/dahdi-sysfs-chan.c --- a/drivers/dahdi/dahdi-sysfs-chan.c 2023-02-02 18:10:37.000000000 +0800 +++ b/drivers/dahdi/dahdi-sysfs-chan.c 2024-06-22 10:47:51.000000000 +0800 @@ -480,7 +480,11 @@ } 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 -uNra a/drivers/dahdi/hpec/dahdi_echocan_hpec.c b/drivers/dahdi/hpec/dahdi_echocan_hpec.c --- a/drivers/dahdi/hpec/dahdi_echocan_hpec.c 2023-02-02 18:10:37.000000000 +0800 +++ b/drivers/dahdi/hpec/dahdi_echocan_hpec.c 2024-06-22 10:47:51.000000000 +0800 @@ -104,7 +104,11 @@ hpec_channel_update(pvt->hpec, isig, iref); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) DEFINE_SEMAPHORE(license_lock); +#else +DEFINE_SEMAPHORE(license_lock, 1); +#endif static int echo_can_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec) diff -uNra a/drivers/dahdi/voicebus/voicebus.c b/modules/dahdi/drivers/dahdi/voicebus/voicebus.c --- a/drivers/dahdi/voicebus/voicebus.c 2023-02-02 18:10:37.000000000 +0800 +++ b/drivers/dahdi/voicebus/voicebus.c 2024-06-22 10:47:51.000000000 +0800 @@ -1135,7 +1135,11 @@ */ 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 -uNra a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c --- a/drivers/dahdi/wctdm24xxp/base.c 2023-02-02 18:10:37.000000000 +0800 +++ b/drivers/dahdi/wctdm24xxp/base.c 2024-06-22 10:47:51.000000000 +0800 @@ -223,7 +223,11 @@ } 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);