diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-14 20:28:32 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-14 20:36:00 -0700 |
commit | 93dee8eea02aefebe2d21128b5f742afe6671f23 (patch) | |
tree | b58337046c9057a7cace9e75bf0643691b09d3a8 /drivers/staging/wilc1000/host_interface.c | |
parent | 4183e9794c751c5139e4599a0c512c7804575a82 (diff) | |
download | op-kernel-dev-93dee8eea02aefebe2d21128b5f742afe6671f23.zip op-kernel-dev-93dee8eea02aefebe2d21128b5f742afe6671f23.tar.gz |
staging: wilc1000: remove WILC_TimerCreate()
It was just a wrapper around setup_timer() and could never fail, so just
call the real function, and fix up the function arguments of the
callbacks to be proper timer callback functions.
Cc: Johnny Kim <johnny.kim@atmel.com>
Cc: Rachel Kim <rachel.kim@atmel.com>
Cc: Dean Lee <dean.lee@atmel.com>
Cc: Chris Park <chris.park@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/host_interface.c')
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 887aec2..bab5319 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3978,11 +3978,11 @@ _done_: * @date * @version 1.0 */ -static void ListenTimerCB(void *pvArg) +static void ListenTimerCB(unsigned long arg) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg; + tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg; /*Stopping remain-on-channel timer*/ del_timer(&pstrWFIDrv->hRemainOnChannel); @@ -4542,8 +4542,9 @@ static int hostIFthread(void *pvArg) return 0; } -static void TimerCB_Scan(void *pvArg) +static void TimerCB_Scan(unsigned long arg) { + void *pvArg = (void *)arg; tstrHostIFmsg strHostIFmsg; /* prepare the Timer Callback message */ @@ -4555,8 +4556,9 @@ static void TimerCB_Scan(void *pvArg) WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL); } -static void TimerCB_Connect(void *pvArg) +static void TimerCB_Connect(unsigned long arg) { + void *pvArg = (void *)arg; tstrHostIFmsg strHostIFmsg; /* prepare the Timer Callback message */ @@ -6415,9 +6417,9 @@ void host_int_send_join_leave_info_to_host * @version 1.0 */ -void GetPeriodicRSSI(void *pvArg) +static void GetPeriodicRSSI(unsigned long arg) { - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg; + tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg; if (pstrWFIDrv == NULL) { PRINT_ER("Driver handler is NULL\n"); @@ -6537,36 +6539,19 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv) s32Error = WILC_FAIL; goto _fail_mq_; } - s32Error = WILC_TimerCreate(&(g_hPeriodicRSSI), GetPeriodicRSSI); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_timer_1; - } + setup_timer(&g_hPeriodicRSSI, GetPeriodicRSSI, 0); WILC_TimerStart(&(g_hPeriodicRSSI), 5000, (void *)pstrWFIDrv); } - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hScanTimer), TimerCB_Scan); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_thread_; - } - - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hConnectTimer), TimerCB_Connect); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_timer_1; - } + setup_timer(&pstrWFIDrv->hScanTimer, TimerCB_Scan, 0); + setup_timer(&pstrWFIDrv->hConnectTimer, TimerCB_Connect, 0); #ifdef WILC_P2P /*Remain on channel timer*/ - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hRemainOnChannel), ListenTimerCB); - if (s32Error < 0) { - PRINT_ER("Failed to creat Remain-on-channel Timer\n"); - goto _fail_timer_3; - } + setup_timer(&pstrWFIDrv->hRemainOnChannel, ListenTimerCB, 0); #endif sema_init(&(pstrWFIDrv->gtOsCfgValuesSem), 1); @@ -6617,15 +6602,12 @@ _fail_mem_: if (pstrWFIDrv != NULL) kfree(pstrWFIDrv); #ifdef WILC_P2P -_fail_timer_3: del_timer_sync(&pstrWFIDrv->hRemainOnChannel); #endif _fail_timer_2: up(&(pstrWFIDrv->gtOsCfgValuesSem)); del_timer_sync(&pstrWFIDrv->hConnectTimer); -_fail_timer_1: del_timer_sync(&pstrWFIDrv->hScanTimer); -_fail_thread_: kthread_stop(HostIFthreadHandler); _fail_mq_: WILC_MsgQueueDestroy(&gMsgQHostIF, NULL); |