Commit 204a8ac1 authored by Binoy Jayan's avatar Binoy Jayan Committed by Greg Kroah-Hartman

rtl8712: Replace semaphore terminate_cmdthread_sema with completion

The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to a struct completion type.
Signed-off-by: default avatarBinoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0f89054a
...@@ -245,7 +245,7 @@ void r8712_stop_drv_threads(struct _adapter *padapter) ...@@ -245,7 +245,7 @@ void r8712_stop_drv_threads(struct _adapter *padapter)
/*Below is to terminate r8712_cmd_thread & event_thread...*/ /*Below is to terminate r8712_cmd_thread & event_thread...*/
complete(&padapter->cmdpriv.cmd_queue_comp); complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread) if (padapter->cmdThread)
_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
padapter->cmdpriv.cmd_seq = 1; padapter->cmdpriv.cmd_seq = 1;
} }
......
...@@ -420,7 +420,7 @@ int r8712_cmd_thread(void *context) ...@@ -420,7 +420,7 @@ int r8712_cmd_thread(void *context)
break; break;
r8712_free_cmd_obj(pcmd); r8712_free_cmd_obj(pcmd);
} while (1); } while (1);
up(&pcmdpriv->terminate_cmdthread_sema); complete(&pcmdpriv->terminate_cmdthread_comp);
thread_exit(); thread_exit();
} }
......
...@@ -58,7 +58,7 @@ No irqsave is necessary. ...@@ -58,7 +58,7 @@ No irqsave is necessary.
static sint _init_cmd_priv(struct cmd_priv *pcmdpriv) static sint _init_cmd_priv(struct cmd_priv *pcmdpriv)
{ {
init_completion(&pcmdpriv->cmd_queue_comp); init_completion(&pcmdpriv->cmd_queue_comp);
sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0); init_completion(&pcmdpriv->terminate_cmdthread_comp);
_init_queue(&(pcmdpriv->cmd_queue)); _init_queue(&(pcmdpriv->cmd_queue));
......
...@@ -51,7 +51,7 @@ struct cmd_obj { ...@@ -51,7 +51,7 @@ struct cmd_obj {
struct cmd_priv { struct cmd_priv {
struct completion cmd_queue_comp; struct completion cmd_queue_comp;
struct semaphore terminate_cmdthread_sema; struct completion terminate_cmdthread_comp;
struct __queue cmd_queue; struct __queue cmd_queue;
u8 cmd_seq; u8 cmd_seq;
u8 *cmd_buf; /*shall be non-paged, and 4 bytes aligned*/ u8 *cmd_buf; /*shall be non-paged, and 4 bytes aligned*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment