summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-mt65xx.c
diff options
context:
space:
mode:
authorLeilk Liu <leilk.liu@mediatek.com>2018-10-31 16:49:16 +0800
committerMark Brown <broonie@kernel.org>2018-10-31 10:00:10 +0000
commita4d8f64f7267a88d4688f5c216926f5f6cafbae6 (patch)
treef368845c8aa106186b0bda49f43336b224600a72 /drivers/spi/spi-mt65xx.c
parent3511ba7d4ca6f39e2d060bb94e42a41ad1fee7bf (diff)
spi: mediatek: use correct mata->xfer_len when in fifo transfer
when xfer_len is greater than 64 bytes and use fifo mode to transfer, the actual length from the third time is mata->xfer_len but not len in mtk_spi_interrupt(). Signed-off-by: Leilk Liu <leilk.liu@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mt65xx.c')
-rw-r--r--drivers/spi/spi-mt65xx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 3dc31627c655..0c2867deb36f 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -522,11 +522,11 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
mdata->xfer_len = min(MTK_SPI_MAX_FIFO_SIZE, len);
mtk_spi_setup_packet(master);
- cnt = len / 4;
+ cnt = mdata->xfer_len / 4;
iowrite32_rep(mdata->base + SPI_TX_DATA_REG,
trans->tx_buf + mdata->num_xfered, cnt);
- remainder = len % 4;
+ remainder = mdata->xfer_len % 4;
if (remainder > 0) {
reg_val = 0;
memcpy(&reg_val,