Skip to content

Commit

Permalink
spi: fsl-lpspi: quit reading rx fifo under error condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gao Pan authored and Mark Brown committed Dec 5, 2016
1 parent b6787b6 commit d989eed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/spi/spi-fsl-lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d989eed

Please sign in to comment.