diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2015-01-28 07:23:48 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-28 14:42:43 -0500 |
commit | c30929415a3d7f186da888d322f93150af308287 (patch) | |
tree | 8a7db031f7f75f840935446133b07f0be22a5331 /drivers/spi | |
parent | 24ba5e593f391507c614f5b62065194e6593a658 (diff) |
spi/xilinx: Make spi_tx and spi_rx simmetric
spi_rx handles the case where the buffer is null. Nevertheless spi_tx
did not handle it, and was handled by the caller function.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-xilinx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index ac94e546a555..6ce1066be98b 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -116,6 +116,10 @@ static unsigned int xspi_read32_be(void __iomem *addr) | |||
116 | 116 | ||
117 | static void xilinx_spi_tx(struct xilinx_spi *xspi) | 117 | static void xilinx_spi_tx(struct xilinx_spi *xspi) |
118 | { | 118 | { |
119 | if (!xspi->tx_ptr) { | ||
120 | xspi->write_fn(0, xspi->regs + XSPI_TXD_OFFSET); | ||
121 | return; | ||
122 | } | ||
119 | xspi->write_fn(*(u32 *)(xspi->tx_ptr), xspi->regs + XSPI_TXD_OFFSET); | 123 | xspi->write_fn(*(u32 *)(xspi->tx_ptr), xspi->regs + XSPI_TXD_OFFSET); |
120 | xspi->tx_ptr += xspi->bits_per_word / 8; | 124 | xspi->tx_ptr += xspi->bits_per_word / 8; |
121 | } | 125 | } |
@@ -230,10 +234,7 @@ static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi, int n_words) | |||
230 | xspi->remaining_bytes -= n_words * xspi->bits_per_word / 8; | 234 | xspi->remaining_bytes -= n_words * xspi->bits_per_word / 8; |
231 | 235 | ||
232 | while (n_words--) | 236 | while (n_words--) |
233 | if (xspi->tx_ptr) | 237 | xilinx_spi_tx(xspi); |
234 | xilinx_spi_tx(xspi); | ||
235 | else | ||
236 | xspi->write_fn(0, xspi->regs + XSPI_TXD_OFFSET); | ||
237 | return; | 238 | return; |
238 | } | 239 | } |
239 | 240 | ||