Skip to content

Commit 9206e82

Browse files
committed
Add conditional compilation for changes with timer symbols in kernel 6.16
Link: https://git.kernel.org/torvalds/c/41cb08555c416 Signed-off-by: Mario Limonciello <[email protected]>
1 parent 0ff1e9d commit 9206e82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

QDMA/linux-kernel/driver/libqdma/qdma_mbox.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,11 @@ static int mbox_rcv_one_msg(struct qdma_mbox *mbox)
308308

309309
static inline void mbox_timer_stop(struct qdma_mbox *mbox)
310310
{
311+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
311312
del_timer(&mbox->timer);
313+
#else
314+
timer_delete_sync(&mbox->timer);
315+
#endif
312316
}
313317

314318
static inline void mbox_timer_start(struct qdma_mbox *mbox)
@@ -432,7 +436,9 @@ static void mbox_timer_handler(struct timer_list *t)
432436
static void mbox_timer_handler(unsigned long arg)
433437
#endif
434438
{
435-
#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
439+
#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 16, 0)
440+
struct qdma_mbox *mbox = timer_container_of(mbox, t, timer);
441+
#elif KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
436442
struct qdma_mbox *mbox = from_timer(mbox, t, timer);
437443
#else
438444
struct qdma_mbox *mbox = (struct qdma_mbox *)arg;

0 commit comments

Comments
 (0)