diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-01-18 18:05:22 +0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-21 22:45:34 +0400 |
commit | 13a4279880229240af38486611c94587492b24d3 (patch) | |
tree | 5f314e84b0e364d24edc616cbd4031a305269ead /drivers/spi/spi.c | |
parent | bd6857a0c630207484a03ddc470fab34b23f80bb (diff) | |
download | linux-13a4279880229240af38486611c94587492b24d3.tar.xz |
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: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 56b41099b40c..8ed1aee13c6f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -599,8 +599,10 @@ static int spi_transfer_one_message(struct spi_master *master, goto out; } - if (ret > 0) + if (ret > 0) { + ret = 0; wait_for_completion(&master->xfer_completion); + } trace_spi_transfer_stop(msg, xfer); |