mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
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 <peter.ujfalusi@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210916125725.25934-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f1291f41af
commit
f6b0c731a0
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user