File 96.patch of Package dahdi-linux

From 9baf903501a797465b47da3a4731411e1b5a1021 Mon Sep 17 00:00:00 2001
From: InterLinked1 <24227567+InterLinked1@users.noreply.github.com>
Date: Sat, 12 Jul 2025 17:52:40 -0400
Subject: [PATCH] kernel.h: Add wrapper for renamed from_timer function.

from_timer was renamed to timer_container_of in kernel commit
41cb08555c4164996d67c78b3bf1c658075b75f1 as part of updates to
the timer APIs. Add a compatibility wrapper for kernels >= 6.16.0.

Resolves: #95
---
 include/dahdi/kernel.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index fdd2f885..6201d9c9 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -58,6 +58,10 @@
 
 #include <linux/poll.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+#define from_timer timer_container_of
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
 #define netif_napi_add netif_napi_add_weight
 #elif defined(RHEL_RELEASE_VERSION) && defined(RHEL_RELEASE_CODE)
openSUSE Build Service is sponsored by