summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx/hif_tx.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2022-02-25 12:24:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-25 14:00:29 +0100
commit1de8eec7c339700e266e9768258eb2e9625a0622 (patch)
tree963161b74f56ab725148dcddc49f66fc8b1b6fd1 /drivers/staging/wfx/hif_tx.c
parenta564d55a0cc123b7ea844b7ca8e79c116914e416 (diff)
staging: wfx: remove duplicated code in wfx_cmd_send()
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>
Diffstat (limited to 'drivers/staging/wfx/hif_tx.c')
-rw-r--r--drivers/staging/wfx/hif_tx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 236f9d62e3a9..0b1ed12c0e83 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -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);