From 58a18179022340c8b0f577067d932f7629741c37 Mon Sep 17 00:00:00 2001 From: horseface Date: Fri, 30 May 2025 09:43:45 +0000 Subject: [PATCH] Use timer_delete_sync() on Linux >= 6.1.84 Update timer deletion to use the new timer_delete_sync() interface introduced in Linux commit 9b13df3f ("timers: Rename del_timer_sync() to timer_delete_sync()"), which replaces the older del_timer_sync() for naming consistency. The legacy del_timer_sync() interface remains as an inline wrapper but is discouraged for new code. Compatibility is maintained using a version check against KERNEL_VERSION(6, 1, 84). --- vwifi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vwifi.c b/vwifi.c index a4fd676..0ec7bd8 100644 --- a/vwifi.c +++ b/vwifi.c @@ -1974,7 +1974,11 @@ static int vwifi_delete_interface(struct vwifi_vif *vif) cancel_work_sync(&vif->ws_scan); cancel_work_sync(&vif->ws_scan_timeout); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 84) + timer_delete_sync(&vif->scan_complete); +#else del_timer_sync(&vif->scan_complete); +#endif /* If there's a pending scan, call cfg80211_scan_done to finish it. */ if (vif->scan_request) { @@ -1985,7 +1989,11 @@ static int vwifi_delete_interface(struct vwifi_vif *vif) } /* Make sure that no work is queued */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 84) + timer_delete_sync(&vif->scan_timeout); +#else del_timer_sync(&vif->scan_timeout); +#endif cancel_work_sync(&vif->ws_connect); cancel_work_sync(&vif->ws_disconnect);