aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-11-12 11:35:46 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2020-11-30 23:47:55 +0100
commitfb0ccf6f24adb2b57805bbe7fe6a1fcf5f8999c3 (patch)
treee8b2bf8ad9bbe504abfacdd493ddd9be79473d1f
parent8e3981354ab30a6ee845f6a5487d455bb906f83e (diff)
downloadbackports-fb0ccf6f24adb2b57805bbe7fe6a1fcf5f8999c3.tar.gz
backports: add tasklet_setup, from_tasklet
Add the new tasklet API Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--backport/backport-include/linux/interrupt.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index f7e7134d..f334a963 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -31,6 +31,23 @@ static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
hrtimer_start(timer, _time, mode);
}
#define hrtimer_start LINUX_BACKPORT(hrtimer_start)
+
+#endif
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+
+static inline void
+tasklet_setup(struct tasklet_struct *t,
+ void (*callback)(struct tasklet_struct *))
+{
+ void (*cb)(unsigned long data) = (void *)callback;
+
+ tasklet_init(t, cb, (unsigned long)t);
+}
+
+#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
+ container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
+
#endif
#endif /* _BP_LINUX_INTERRUPT_H */