aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <[email protected]>2021-09-16 15:57:25 +0300
committerMark Brown <[email protected]>2021-09-17 13:17:45 +0100
commitf6b0c731a01fc581fcc4fb227e2d3ad9e0cb31d6 (patch)
tree295e25569dc5e75269419cf242fe266ab3673229
parentf1291f41afa9d1901dd954c52869cd0e09c06652 (diff)
ASoC: SOF: ipc: Remove redundant error check from sof_ipc_tx_message_unlocked
If the snd_sof_dsp_send_msg() failed then we have already returned from sof_ipc_tx_message_unlocked() with the error message. There is no need to check if ret is really 0 after this and we can return directly the return value from tx_wait_done() At the same time make the remaining checks for error (ret) to match. Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/sof/ipc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index 8145b0d5564a..ff27437a3a6c 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -309,7 +309,7 @@ static int sof_ipc_tx_message_unlocked(struct snd_sof_ipc *ipc, u32 header,
spin_unlock_irq(&sdev->ipc_lock);
- if (ret < 0) {
+ if (ret) {
dev_err_ratelimited(sdev->dev,
"error: ipc tx failed with error %d\n",
ret);
@@ -319,10 +319,7 @@ static int sof_ipc_tx_message_unlocked(struct snd_sof_ipc *ipc, u32 header,
ipc_log_header(sdev->dev, "ipc tx", msg->header);
/* now wait for completion */
- if (!ret)
- ret = tx_wait_done(ipc, msg, reply_data);
-
- return ret;
+ return tx_wait_done(ipc, msg, reply_data);
}
/* send IPC message from host to DSP */