summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-03-04 23:57:05 +0100
committerJohannes Berg <johannes.berg@intel.com>2018-03-21 09:19:32 +0100
commit88935359564216a49657078bcab83659b9059478 (patch)
tree3f2f352fda7cb79904cf17336b4cb95b43a20b9d
parent9436e5946ad610081f5564f6e1fb233f62698060 (diff)
compat: timer.h: Remove last parameters from DEFINE_TIMER
DEFINE_TIMER only has 2 parameters since kernel commit 1d27e3e2252ba ("timer: Remove expires and data arguments from DEFINE_TIMER") which was added with kernel 4.15. Add a version which translates between the new and the old API. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--backport/backport-include/linux/timer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
index 9824ea6b..69590bb7 100644
--- a/backport/backport-include/linux/timer.h
+++ b/backport/backport-include/linux/timer.h
@@ -60,4 +60,11 @@ static inline void timer_setup(struct timer_list *timer,
container_of(callback_timer, typeof(*var), timer_fieldname)
#endif
+#if LINUX_VERSION_IS_LESS(4,15,0)
+#undef DEFINE_TIMER
+#define DEFINE_TIMER(_name, _function) \
+ struct timer_list _name = \
+ __TIMER_INITIALIZER(_function, 0, 0, 0)
+#endif
+
#endif /* _BACKPORT_TIMER_H */