Commit 13a42798 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

spi: core: Fix transfer failure when master->transfer_one returns positive value

master->transfer_one returns positive value is not a error.
So set ret to 0 when master->transfer_one returns positive value.
Otherwise, I hit "spi_master spi0: failed to transfer one message from queue"
error when my transfer_one callback returns 1.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent bd6857a0
...@@ -599,8 +599,10 @@ static int spi_transfer_one_message(struct spi_master *master, ...@@ -599,8 +599,10 @@ static int spi_transfer_one_message(struct spi_master *master,
goto out; goto out;
} }
if (ret > 0) if (ret > 0) {
ret = 0;
wait_for_completion(&master->xfer_completion); wait_for_completion(&master->xfer_completion);
}
trace_spi_transfer_stop(msg, xfer); trace_spi_transfer_stop(msg, xfer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment