Hi, Am Do den 20. Dez 2018 um 18:56 schrieb Ben Hutchings: > This patch is no longer sufficient, as oss4 is further broken by the > timer API change in Linux 4.15:
I have the patch in attachment in use up to kernel 4.18. Regards Klaus -- Klaus Ethgen http://www.ethgen.ch/ pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen <[email protected]> Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C
diff -Nur modules/oss4.orig/core/oss_core.c modules/oss4/core/oss_core.c
--- modules/oss4.orig/core/oss_core.c 2017-07-26 15:03:52.000000000 +0100
+++ modules/oss4/core/oss_core.c 2018-03-10 10:13:12.890910729 +0100
@@ -498,6 +498,9 @@
int timestamp;
void (*func) (void *);
void *arg;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ int data;
+#endif
struct timer_list timer;
} tmout_desc_t;
@@ -510,8 +513,15 @@
int timeout_random = 0x12123400;
void
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+oss_timer_callback (struct timer_list *t)
+{
+ tmout_desc_t *priv = container_of(t, typeof(*priv), timer);
+ int id = priv->data;
+#else
oss_timer_callback (unsigned long id)
{
+#endif
tmout_desc_t *tmout;
int ix;
void *arg;
@@ -570,10 +580,17 @@
tmout->arg = arg;
tmout->timestamp = id | (timeout_random & ~0xff);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ tmout->data = id | (timeout_random & ~0xff);
+ timer_setup (&tmout->timer, oss_timer_callback, 0);
+#else
init_timer (&tmout->timer);
+#endif
tmout->timer.expires = jiffies + ticks;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
tmout->timer.data = id | (timeout_random & ~0xff);
tmout->timer.function = oss_timer_callback;
+#endif
add_timer (&tmout->timer);
return id | (timeout_random & ~0xff);
signature.asc
Description: PGP signature

