Skip to content

Commit

Permalink
spi/davinci: Fix DMA API usage in davinci
Browse files Browse the repository at this point in the history
The driver uses NULL for dma_unmap_single instead of
the struct device that the API expects.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Tested-by: Akshay Shankarmurthy <akshay.s@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Shubhrajyoti D authored and Grant Likely committed Mar 30, 2012
1 parent 327ef2e commit 9232b9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n",
rx_buf_count);
if (t->tx_buf)
dma_unmap_single(NULL, t->tx_dma, t->len,
dma_unmap_single(&spi->dev, t->tx_dma, t->len,
DMA_TO_DEVICE);
return -ENOMEM;
}
Expand Down Expand Up @@ -692,10 +692,10 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
if (spicfg->io_type == SPI_IO_TYPE_DMA) {

if (t->tx_buf)
dma_unmap_single(NULL, t->tx_dma, t->len,
dma_unmap_single(&spi->dev, t->tx_dma, t->len,
DMA_TO_DEVICE);

dma_unmap_single(NULL, t->rx_dma, rx_buf_count,
dma_unmap_single(&spi->dev, t->rx_dma, rx_buf_count,
DMA_FROM_DEVICE);

clear_io_bits(dspi->base + SPIINT, SPIINT_DMA_REQ_EN);
Expand Down

0 comments on commit 9232b9b

Please sign in to comment.