summaryrefslogtreecommitdiff
path: root/pkgs/os-specific/linux/yt6801/kernel_6_16_fix.patch
blob: 345905dc4f50ad40c5acdf420a97c80c44d0f54a (plain)
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
--- a/src/fuxi-gmac-phy.c	2025-08-03 00:00:00.000000000 +0000
+++ b/src/fuxi-gmac-phy.c	2025-08-03 00:00:00.000000000 +0000
@@ -322,8 +322,10 @@
 static void fxgmac_phy_link_poll(unsigned long data)
 #endif
 {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0))
+    struct fxgmac_pdata *pdata = container_of(t, struct fxgmac_pdata, expansion.phy_poll_tm);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
     struct fxgmac_pdata *pdata = from_timer(pdata, t, expansion.phy_poll_tm);
 #else
     struct fxgmac_pdata *pdata = (struct fxgmac_pdata*)data;
 #endif
@@ -350,13 +352,17 @@

 int fxgmac_phy_timer_init(struct fxgmac_pdata *pdata)
 {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0))
+    timer_setup(&pdata->expansion.phy_poll_tm, fxgmac_phy_link_poll, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
     init_timer_key(&pdata->expansion.phy_poll_tm, NULL, 0, "fuxi_phy_link_update_timer", NULL);
 #else
     init_timer_key(&pdata->expansion.phy_poll_tm, 0, "fuxi_phy_link_update_timer", NULL);
 #endif
     pdata->expansion.phy_poll_tm.expires = jiffies + HZ / 2;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0))
     pdata->expansion.phy_poll_tm.function = (void *)(fxgmac_phy_link_poll);
+#endif
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
     pdata->expansion.phy_poll_tm.data = (unsigned long)pdata;
 #endif