summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-lpspi.c
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2016-12-02 11:50:01 +0800
committerMark Brown <broonie@kernel.org>2016-12-05 11:45:03 +0000
commitd989eed20791534dc624c7b29568b263c67a286f (patch)
tree440107ed52f4172f764b6dad26a3a0ee92479ddf /drivers/spi/spi-fsl-lpspi.c
parentb6787b6807fb01b13f0f1a07cbb8eaf7853d1a6e (diff)
downloadlinux-stable-d989eed20791534dc624c7b29568b263c67a286f.tar.gz
linux-stable-d989eed20791534dc624c7b29568b263c67a286f.tar.bz2
linux-stable-d989eed20791534dc624c7b29568b263c67a286f.zip
spi: fsl-lpspi: quit reading rx fifo under error condition
In case that error occurs during waiting for txfifo empty, it is not necessary to read rx fifo. It's better to return directly. Signed-off-by: Gao Pan <pandy.gao@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lpspi.c')
-rw-r--r--drivers/spi/spi-fsl-lpspi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index c4a4e2622a53..52551f6d0c7d 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -350,9 +350,12 @@ static int fsl_lpspi_transfer_one(struct spi_master *master,
}
ret = fsl_lpspi_txfifo_empty(fsl_lpspi);
+ if (ret)
+ return ret;
+
fsl_lpspi_read_rx_fifo(fsl_lpspi);
- return ret;
+ return 0;
}
static int fsl_lpspi_transfer_one_msg(struct spi_master *master,