staging: wfx: remove duplicated code in wfx_cmd_send()
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Fri, 25 Feb 2022 11:24:02 +0000 (12:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 13:00:29 +0000 (14:00 +0100)
The code to execute on end of the function is the same whatever the
command replies or not.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220225112405.355599-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_tx.c

index 236f9d6..0b1ed12 100644 (file)
@@ -74,9 +74,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
        if (no_reply) {
                /* Chip won't reply. Give enough time to the wq to send the buffer. */
                msleep(100);
-               wdev->hif_cmd.buf_send = NULL;
-               mutex_unlock(&wdev->hif_cmd.lock);
-               return 0;
+               ret = 0;
+               goto end;
        }
 
        if (wdev->poll_irq)
@@ -98,6 +97,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
                ret = wdev->hif_cmd.ret;
        }
 
+end:
        wdev->hif_cmd.buf_send = NULL;
        mutex_unlock(&wdev->hif_cmd.lock);