mxm_wifiex: fix build error on L6.15 kernel next tree

When build wifi driver based on L6.15 kernel next tree, will observe the
following build error. This is caused by the upstream patch:
8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()")
Need to change corresponding API here to avoid the build break.

Build error logs:
In file included from mlinux/moal_ioctl.c:28:
mlinux/moal_main.h: In function ‘woal_cancel_timer’:
mlinux/moal_main.h:572:17: error: implicit declaration of function ‘del_timer’; did you mean ‘add_timer’? [-Werror=implicit-function-declaration]
  572 |                 del_timer(&timer->tl);
      |                 ^~~~~~~~~
      |                 add_timer
mlinux/moal_main.h:574:17: error: implicit declaration of function ‘del_timer_sync’; did you mean ‘dev_mc_sync’? [-Werror=implicit-function-declaration]
  574 |                 del_timer_sync(&timer->tl);
      |                 ^~~~~~~~~~~~~~
      |                 dev_mc_sync

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2025-05-03 17:02:53 +08:00
parent 2da89e4cad
commit 91d2e896ac

View file

@ -569,9 +569,17 @@ static inline void woal_mod_timer(pmoal_drv_timer timer,
static inline void woal_cancel_timer(moal_drv_timer *timer)
{
if (timer->timer_is_periodic || in_atomic() || irqs_disabled())
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete(&timer->tl);
#else
del_timer(&timer->tl);
#endif
else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete_sync(&timer->tl);
#else
del_timer_sync(&timer->tl);
#endif
timer->timer_is_canceled = MTRUE;
timer->time_period = 0;
}