Merge branch 'spi-4.20' into spi-4.21 for uniphier DT
authorMark Brown <broonie@kernel.org>
Tue, 6 Nov 2018 19:08:00 +0000 (19:08 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 6 Nov 2018 19:08:00 +0000 (19:08 +0000)
drivers/spi/spi-mt65xx.c

index f3119d82150eb43e32f4b0eadfdfe26aacca6c4b..9ee1fe968a2dd92d294b9aac36092490ea8532d6 100644 (file)
@@ -531,11 +531,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,