Commit c5a2a394 authored by Kevin Hilman's avatar Kevin Hilman Committed by Mark Brown

spi: davinci: use dma_mapping_error()

The correct error checking for dma_map_single() is to use
dma_mapping_error().
Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fafd6794
...@@ -646,7 +646,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -646,7 +646,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
buf = t->rx_buf; buf = t->rx_buf;
t->rx_dma = dma_map_single(&spi->dev, buf, t->rx_dma = dma_map_single(&spi->dev, buf,
t->len, DMA_FROM_DEVICE); t->len, DMA_FROM_DEVICE);
if (!t->rx_dma) { if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
ret = -EFAULT; ret = -EFAULT;
goto err_rx_map; goto err_rx_map;
} }
...@@ -660,7 +660,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -660,7 +660,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
buf = (void *)t->tx_buf; buf = (void *)t->tx_buf;
t->tx_dma = dma_map_single(&spi->dev, buf, t->tx_dma = dma_map_single(&spi->dev, buf,
t->len, DMA_TO_DEVICE); t->len, DMA_TO_DEVICE);
if (!t->tx_dma) { if (dma_mapping_error(&spi->dev, t->tx_dma)) {
ret = -EFAULT; ret = -EFAULT;
goto err_tx_map; goto err_tx_map;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment