diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/davinci_spi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index 6beab99bf95b..68ed377cc626 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c | |||
@@ -591,10 +591,10 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
591 | 591 | ||
592 | if (t->tx_buf) { | 592 | if (t->tx_buf) { |
593 | t->tx_dma = dma_map_single(&spi->dev, (void *)t->tx_buf, | 593 | t->tx_dma = dma_map_single(&spi->dev, (void *)t->tx_buf, |
594 | dspi->wcount, DMA_TO_DEVICE); | 594 | t->len, DMA_TO_DEVICE); |
595 | if (dma_mapping_error(&spi->dev, t->tx_dma)) { | 595 | if (dma_mapping_error(&spi->dev, t->tx_dma)) { |
596 | dev_dbg(sdev, "Unable to DMA map %d bytes" | 596 | dev_dbg(sdev, "Unable to DMA map %d bytes" |
597 | "TX buffer\n", dspi->wcount); | 597 | "TX buffer\n", t->len); |
598 | return -ENOMEM; | 598 | return -ENOMEM; |
599 | } | 599 | } |
600 | } | 600 | } |
@@ -624,7 +624,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
624 | 624 | ||
625 | if (t->rx_buf) { | 625 | if (t->rx_buf) { |
626 | rx_buf = t->rx_buf; | 626 | rx_buf = t->rx_buf; |
627 | rx_buf_count = dspi->rcount; | 627 | rx_buf_count = t->len; |
628 | } else { | 628 | } else { |
629 | rx_buf = dspi->rx_tmp_buf; | 629 | rx_buf = dspi->rx_tmp_buf; |
630 | rx_buf_count = sizeof(dspi->rx_tmp_buf); | 630 | rx_buf_count = sizeof(dspi->rx_tmp_buf); |
@@ -636,7 +636,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
636 | dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n", | 636 | dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n", |
637 | rx_buf_count); | 637 | rx_buf_count); |
638 | if (t->tx_buf) | 638 | if (t->tx_buf) |
639 | dma_unmap_single(NULL, t->tx_dma, dspi->wcount, | 639 | dma_unmap_single(NULL, t->tx_dma, t->len, |
640 | DMA_TO_DEVICE); | 640 | DMA_TO_DEVICE); |
641 | return -ENOMEM; | 641 | return -ENOMEM; |
642 | } | 642 | } |
@@ -675,7 +675,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
675 | if (spicfg->io_type == SPI_IO_TYPE_DMA) { | 675 | if (spicfg->io_type == SPI_IO_TYPE_DMA) { |
676 | 676 | ||
677 | if (t->tx_buf) | 677 | if (t->tx_buf) |
678 | dma_unmap_single(NULL, t->tx_dma, dspi->wcount, | 678 | dma_unmap_single(NULL, t->tx_dma, t->len, |
679 | DMA_TO_DEVICE); | 679 | DMA_TO_DEVICE); |
680 | 680 | ||
681 | dma_unmap_single(NULL, t->rx_dma, rx_buf_count, | 681 | dma_unmap_single(NULL, t->rx_dma, rx_buf_count, |