diff --git a/xpad.c b/xpad.c index 43601f0..4f94b8d 100644 --- a/xpad.c +++ b/xpad.c @@ -62,6 +62,7 @@ */ // #define DEBUG +#include #include #include #include @@ -73,6 +74,11 @@ #include #include +// backward compatibility. del_timer_sync is renamed to timer_delete_sync since 6.15.0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,15,0) +#define timer_delete_sync del_timer_sync +#endif + // enable compilation on pre 6.1 kernels #ifndef ABS_PROFILE #define ABS_PROFILE ABS_MISC @@ -2520,7 +2526,7 @@ static void xpad_disconnect(struct usb_interface *intf) if (xpad->quirks & QUIRK_GHL_XBOXONE) { usb_free_urb(xpad->ghl_urb); - del_timer_sync(&xpad->ghl_poke_timer); + timer_delete_sync(&xpad->ghl_poke_timer); } usb_free_coherent(xpad->udev, XPAD_PKT_LEN,