summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-09-07 22:52:43 +0200
committerMark Brown <broonie@kernel.org>2016-09-12 19:58:45 +0100
commit84ccfc371f4a8d1ff86efd7ca7914e33b90325c2 (patch)
treecd5ac36d8cbb1b9b496b7e4357b5404a5894bfe8 /drivers/spi
parent809b1e017bbdaf40d35619e41c1dbc542a5449d2 (diff)
downloadlinux-84ccfc371f4a8d1ff86efd7ca7914e33b90325c2.tar.gz
linux-84ccfc371f4a8d1ff86efd7ca7914e33b90325c2.tar.bz2
linux-84ccfc371f4a8d1ff86efd7ca7914e33b90325c2.zip
spi: fsl-espi: improve return value handling in fsl_espi_bufs
Return a proper status code from fsl_espi_bufs instead of returning the number of remaining words and let the caller evaluate it. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-fsl-espi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index f8a6dd13ee02..8d6a570ac704 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -258,7 +258,7 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
/* disable rx ints */
mpc8xxx_spi_write_reg(&reg_base->mask, 0);
- return mpc8xxx_spi->count;
+ return mpc8xxx_spi->count > 0 ? -EMSGSIZE : 0;
}
static int fsl_espi_do_trans(struct spi_message *m, struct spi_transfer *trans)
@@ -288,9 +288,6 @@ static int fsl_espi_do_trans(struct spi_message *m, struct spi_transfer *trans)
if (trans->len)
ret = fsl_espi_bufs(spi, trans);
- if (ret)
- ret = -EMSGSIZE;
-
if (trans->delay_usecs)
udelay(trans->delay_usecs);