486d10ea58f83886f7c14db73c5396c64137fad9
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / subsys / 073-backports-backport-tasklet_setup-from_tasklet.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 11 Nov 2020 13:34:26 +0100
3 Subject: [PATCH] backports: backport tasklet_setup, from_tasklet
4
5 Backport the new tasklet API
6
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 ---
9
10 --- a/backport-include/linux/interrupt.h
11 +++ b/backport-include/linux/interrupt.h
12 @@ -31,6 +31,23 @@ static inline void backport_hrtimer_star
13 hrtimer_start(timer, _time, mode);
14 }
15 #define hrtimer_start LINUX_BACKPORT(hrtimer_start)
16 +
17 +#endif
18 +
19 +#if LINUX_VERSION_IS_LESS(5,9,0)
20 +
21 +static inline void
22 +tasklet_setup(struct tasklet_struct *t,
23 + void (*callback)(struct tasklet_struct *))
24 +{
25 + void (*cb)(unsigned long data) = (void *)callback;
26 +
27 + tasklet_init(t, cb, (unsigned long)t);
28 +}
29 +
30 +#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
31 + container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
32 +
33 #endif
34
35 #endif /* _BP_LINUX_INTERRUPT_H */