mirror of
https://github.com/chinawrj/rtl8812au
synced 2024-11-27 23:54:24 +00:00
Fix API change in kernel v4.15
In this kernel, the timer setup and handlers changed quite a bit.
This commit is contained in:
parent
8be9e78a4b
commit
2e1e972bf5
@ -1815,9 +1815,17 @@ void BlinkHandler(PLED_USB pLed)
|
||||
* Callback function of LED BlinkTimer,
|
||||
* it just schedules to corresponding BlinkWorkItem/led_blink_hdl
|
||||
* */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
void BlinkTimerCallback(struct timer_list *t)
|
||||
#else
|
||||
void BlinkTimerCallback(void *data)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
PLED_USB pLed = from_timer(pLed, t, BlinkTimer);
|
||||
#else
|
||||
PLED_USB pLed = (PLED_USB)data;
|
||||
#endif
|
||||
_adapter *padapter = pLed->padapter;
|
||||
|
||||
/* RTW_INFO("%s\n", __FUNCTION__); */
|
||||
@ -4229,7 +4237,11 @@ InitLed(
|
||||
pLed->LedPin = LedPin;
|
||||
|
||||
ResetLedStatus(pLed);
|
||||
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
|
||||
#else
|
||||
_init_timer(&pLed->BlinkTimer, padapter->pnetdev, BlinkTimerCallback, pLed);
|
||||
#endif
|
||||
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user