Message ID | 20180304225717.20890-4-hauke@hauke-m.de (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Sun, 2018-03-04 at 23:57 +0100, Hauke Mehrtens wrote: > Use the unsigned long parameters on kernel versions < 4.15 for the > DEFINE_TIMER callback. This was changed in Linux mainline commit > 24ed960abf1d ("treewide: Switch DEFINE_TIMER callbacks to struct > timer_list *") But before this, we had a macro that could deal with both ways - why can't we backport using a similar macro, rather than doing a patch? If we have static void at76_ledtrig_tx_timerfunc(struct timer_list *unused); then we should be able to #define DEFINE_TIMER(x, y) ... (cast)(y) or something, no? johannes -- To unsubscribe from this list: send the line "unsubscribe backports" in
diff --git a/patches/0083-timer_list.patch b/patches/0083-timer_list.patch new file mode 100644 index 00000000..dca3b948 --- /dev/null +++ b/patches/0083-timer_list.patch @@ -0,0 +1,22 @@ +--- a/drivers/net/wireless/atmel/at76c50x-usb.c ++++ b/drivers/net/wireless/atmel/at76c50x-usb.c +@@ -518,11 +518,19 @@ exit: + + /* LED trigger */ + static int tx_activity; ++#if LINUX_VERSION_IS_LESS(4,15,0) ++static void at76_ledtrig_tx_timerfunc(unsigned long data); ++#else + static void at76_ledtrig_tx_timerfunc(struct timer_list *unused); ++#endif + static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc); + DEFINE_LED_TRIGGER(ledtrig_tx); + ++#if LINUX_VERSION_IS_LESS(4,15,0) ++static void at76_ledtrig_tx_timerfunc(unsigned long data) ++#else + static void at76_ledtrig_tx_timerfunc(struct timer_list *unused) ++#endif + { + static int tx_lastactivity; +
Use the unsigned long parameters on kernel versions < 4.15 for the DEFINE_TIMER callback. This was changed in Linux mainline commit 24ed960abf1d ("treewide: Switch DEFINE_TIMER callbacks to struct timer_list *") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- patches/0083-timer_list.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/0083-timer_list.patch