073-backports-backport-tasklet_setup-from_tasklet.patch 897 B

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