1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
From 97ddc508c982fb2f700a098b5eb3e75ff40962b5 Mon Sep 17 00:00:00 2001
From: wangyifan <wangyifan@acoinfo.com>
Date: Mon, 9 Jun 2025 20:51:03 +0800
Subject: [PATCH] fix del timer
---
driver/ch9344.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/driver/ch9344.c b/driver/ch9344.c
index 36402c0..1a8882a 100644
--- a/driver/ch9344.c
+++ b/driver/ch9344.c
@@ -929,7 +929,11 @@ static void timer_function(unsigned long arg)
static void timer_function(struct timer_list *t)
{
unsigned char *buffer;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0)
+ struct ch9344_ttyport *ttyport = container_of(t, struct ch9344_ttyport, timer);
+#else
struct ch9344_ttyport *ttyport = from_timer(ttyport, t, timer);
+#endif
int fifolen = kfifo_len(&ttyport->rfifo);
int len;
@@ -1251,7 +1255,11 @@ static void ch9344_port_shutdown(struct tty_port *port)
struct ch9344 *ch9344 = tty_get_portdata(ttyport);
int portnum = ttyport->portnum;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
+ timer_shutdown_sync(&ttyport->timer);
+#else
del_timer(&ttyport->timer);
+#endif
ch9344_set_control(ch9344, portnum, 0x00);
ch9344_set_control(ch9344, portnum, 0x10);
ttyport->isopen = false;
--
2.50.1
|