]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtl8712: Replace semaphore terminate_cmdthread_sema with completion
authorBinoy Jayan <binoy.jayan@linaro.org>
Thu, 2 Jun 2016 04:24:08 +0000 (09:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2016 16:25:47 +0000 (18:25 +0200)
The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to a struct completion type.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/os_intfs.c
drivers/staging/rtl8712/rtl8712_cmd.c
drivers/staging/rtl8712/rtl871x_cmd.c
drivers/staging/rtl8712/rtl871x_cmd.h

index 44301258688ac6cb089c654e6350097099f2ef9a..b615fbfa30ab431a18d66d3869eeca663d64810c 100644 (file)
@@ -245,7 +245,7 @@ void r8712_stop_drv_threads(struct _adapter *padapter)
        /*Below is to terminate r8712_cmd_thread & event_thread...*/
        complete(&padapter->cmdpriv.cmd_queue_comp);
        if (padapter->cmdThread)
-               _down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
+               wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
        padapter->cmdpriv.cmd_seq = 1;
 }
 
index 08f3f49ea15dc225353fae67b681a3ea15209f62..3877fcf65d95581db0a5ab307367237b9f3ef828 100644 (file)
@@ -420,7 +420,7 @@ _next:
                        break;
                r8712_free_cmd_obj(pcmd);
        } while (1);
-       up(&pcmdpriv->terminate_cmdthread_sema);
+       complete(&pcmdpriv->terminate_cmdthread_comp);
        thread_exit();
 }
 
index 82854ec6b117664912f508844ae83465b1a9a43f..5838696bbece2b437095c4f48ffe6cd9dabecd6b 100644 (file)
@@ -58,7 +58,7 @@ No irqsave is necessary.
 static sint _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);
 
        _init_queue(&(pcmdpriv->cmd_queue));
 
index 1907bc90e068287741e564de726ee0a4ede7f394..ebd2e1d3e762e251d3a6812df6f5e94eb7a18489 100644 (file)
@@ -51,7 +51,7 @@ struct cmd_obj {
 
 struct cmd_priv {
        struct completion cmd_queue_comp;
-       struct semaphore terminate_cmdthread_sema;
+       struct completion terminate_cmdthread_comp;
        struct  __queue cmd_queue;
        u8 cmd_seq;
        u8 *cmd_buf;    /*shall be non-paged, and 4 bytes aligned*/