diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2016-09-07 22:52:43 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-12 20:58:45 +0200 |
commit | 84ccfc371f4a8d1ff86efd7ca7914e33b90325c2 (patch) | |
tree | cd5ac36d8cbb1b9b496b7e4357b5404a5894bfe8 /drivers/spi/spi-fsl-espi.c | |
parent | spi: fsl-espi: merge fsl_espi_cmd_trans and fsl_espi_rw_trans (diff) | |
download | linux-84ccfc371f4a8d1ff86efd7ca7914e33b90325c2.tar.xz 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/spi-fsl-espi.c')
-rw-r--r-- | drivers/spi/spi-fsl-espi.c | 5 |
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(®_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); |