Update hal_usb_led.c

This commit is contained in:
Christian B 2017-12-17 11:53:07 +01:00 committed by GitHub
parent dd6d41d60b
commit d91f4be99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1815,17 +1815,9 @@ void BlinkHandler(PLED_USB pLed)
* Callback function of LED BlinkTimer, * Callback function of LED BlinkTimer,
* it just schedules to corresponding BlinkWorkItem/led_blink_hdl * 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) 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; PLED_USB pLed = (PLED_USB)data;
#endif
_adapter *padapter = pLed->padapter; _adapter *padapter = pLed->padapter;
/* RTW_INFO("%s\n", __FUNCTION__); */ /* RTW_INFO("%s\n", __FUNCTION__); */
@ -4237,11 +4229,7 @@ InitLed(
pLed->LedPin = LedPin; pLed->LedPin = LedPin;
ResetLedStatus(pLed); ResetLedStatus(pLed);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) _init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#else
_init_timer(&pLed->BlinkTimer, padapter->pnetdev, BlinkTimerCallback, pLed);
#endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
} }