The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to struct completion.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
{
init_completion(&pcmdpriv->cmd_queue_comp);
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
{
init_completion(&pcmdpriv->cmd_queue_comp);
- sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0);
+ init_completion(&pcmdpriv->terminate_cmdthread_comp);
_rtw_init_queue(&(pcmdpriv->cmd_queue));
return _SUCCESS;
_rtw_init_queue(&(pcmdpriv->cmd_queue));
return _SUCCESS;
allow_signal(SIGTERM);
pcmdpriv->cmdthd_running = true;
allow_signal(SIGTERM);
pcmdpriv->cmdthd_running = true;
- up(&pcmdpriv->terminate_cmdthread_sema);
+ complete(&pcmdpriv->terminate_cmdthread_comp);
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
rtw_free_cmd_obj(pcmd);
}
rtw_free_cmd_obj(pcmd);
}
- up(&pcmdpriv->terminate_cmdthread_sema);
+ complete(&pcmdpriv->terminate_cmdthread_comp);
complete_and_exit(NULL, 0);
complete_and_exit(NULL, 0);
struct cmd_priv {
struct completion cmd_queue_comp;
struct cmd_priv {
struct completion cmd_queue_comp;
- struct semaphore terminate_cmdthread_sema;
+ struct completion terminate_cmdthread_comp;
struct __queue cmd_queue;
u8 cmdthd_running;
struct adapter *padapter;
struct __queue cmd_queue;
u8 cmdthd_running;
struct adapter *padapter;
err = PTR_ERR(padapter->cmdThread);
else
/* wait for cmd_thread to run */
err = PTR_ERR(padapter->cmdThread);
else
/* wait for cmd_thread to run */
- _rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+ wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
/* Below is to terminate rtw_cmd_thread & event_thread... */
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
/* Below is to terminate rtw_cmd_thread & event_thread... */
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
- _rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+ wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);