diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2016-09-07 22:51:29 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-12 20:58:45 +0200 |
commit | 0319d4991ea6e7594f32843e1b47868737056799 (patch) | |
tree | 3dff2643578bfa72c328972a94ef3a1acec5d7f3 /drivers/spi | |
parent | spi: fsl-espi: remove element status from struct fsl_espi_transfer (diff) | |
download | linux-0319d4991ea6e7594f32843e1b47868737056799.tar.xz linux-0319d4991ea6e7594f32843e1b47868737056799.zip |
spi: fsl-espi: fix status handling in fsl_espi_do_one_msg
If an error occurred during message handling return this error instead
of always returning 0 and align the code with the generic
implementation in spi_transfer_one_message.
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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 5f01b6595442..6b60f7b29869 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -381,9 +381,12 @@ static int fsl_espi_do_one_msg(struct spi_master *master, ret = fsl_espi_rw_trans(m, &espi_trans, rx_buf); m->actual_length = espi_trans.actual_length; - m->status = ret; + if (m->status == -EINPROGRESS) + m->status = ret; + spi_finalize_current_message(master); - return 0; + + return ret; } static int fsl_espi_setup(struct spi_device *spi) |