From 67775a5961fa9ab37871c3d3aa205a1705e51b34 Mon Sep 17 00:00:00 2001 From: Sergey Belozyorcev Date: Sun, 1 Jun 2025 22:43:03 +0300 Subject: [PATCH] Compatibility with kernel 6.15.0 Renamed del_timer_sync to timer_delete_sync. Reason: https://github.com/torvalds/linux/commit/8fa7292fee5c5240402371ea89ab285ec856c916 Compatibility with older kernels has been preserved. --- xpad.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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,