diff options
-rw-r--r-- | drivers/spi/atmel_spi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 1d8a2f6bb8eb..8b2601de3630 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -113,16 +113,16 @@ static void atmel_spi_next_xfer(struct spi_master *master, | |||
113 | 113 | ||
114 | len = as->remaining_bytes; | 114 | len = as->remaining_bytes; |
115 | 115 | ||
116 | tx_dma = xfer->tx_dma; | 116 | tx_dma = xfer->tx_dma + xfer->len - len; |
117 | rx_dma = xfer->rx_dma; | 117 | rx_dma = xfer->rx_dma + xfer->len - len; |
118 | 118 | ||
119 | /* use scratch buffer only when rx or tx data is unspecified */ | 119 | /* use scratch buffer only when rx or tx data is unspecified */ |
120 | if (rx_dma == INVALID_DMA_ADDRESS) { | 120 | if (!xfer->rx_buf) { |
121 | rx_dma = as->buffer_dma; | 121 | rx_dma = as->buffer_dma; |
122 | if (len > BUFFER_SIZE) | 122 | if (len > BUFFER_SIZE) |
123 | len = BUFFER_SIZE; | 123 | len = BUFFER_SIZE; |
124 | } | 124 | } |
125 | if (tx_dma == INVALID_DMA_ADDRESS) { | 125 | if (!xfer->tx_buf) { |
126 | tx_dma = as->buffer_dma; | 126 | tx_dma = as->buffer_dma; |
127 | if (len > BUFFER_SIZE) | 127 | if (len > BUFFER_SIZE) |
128 | len = BUFFER_SIZE; | 128 | len = BUFFER_SIZE; |