Skip to content

Commit 9caad15

Browse files
belozerparoj
authored andcommitted
Compatibility with kernel 6.16.0
Renamed del_timer_sync to timer_delete_sync. Reason: torvalds/linux@41cb08555c416 Compatibility with older kernels has been preserved.
1 parent 902ffab commit 9caad15

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xpad.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
#define timer_delete_sync del_timer_sync
8080
#endif
8181

82+
// backward compatibility. from_timer is renamed to timer_container_of since 6.16.0
83+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
84+
#define timer_container_of from_timer
85+
#endif
86+
8287
// enable compilation on pre 6.1 kernels
8388
#ifndef ABS_PROFILE
8489
#define ABS_PROFILE ABS_MISC
@@ -846,7 +851,7 @@ static void ghl_magic_poke_cb(struct urb *urb)
846851
static void ghl_magic_poke(struct timer_list *t)
847852
{
848853
int ret;
849-
struct usb_xpad *xpad = from_timer(xpad, t, ghl_poke_timer);
854+
struct usb_xpad *xpad = timer_container_of(xpad, t, ghl_poke_timer);
850855

851856
ret = usb_submit_urb(xpad->ghl_urb, GFP_ATOMIC);
852857
if (ret < 0)

0 commit comments

Comments
 (0)