Skip to content

Commit 11dd9e2

Browse files
khilmangregkh
authored andcommitted
spi: davinci: use dma_mapping_error()
[ Upstream commit c5a2a394835f473ae23931eda5066d3771d7b2f8 ] The correct error checking for dma_map_single() is to use dma_mapping_error(). Signed-off-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent be91b09 commit 11dd9e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/spi/spi-davinci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
651651
buf = t->rx_buf;
652652
t->rx_dma = dma_map_single(&spi->dev, buf,
653653
t->len, DMA_FROM_DEVICE);
654-
if (!t->rx_dma) {
654+
if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
655655
ret = -EFAULT;
656656
goto err_rx_map;
657657
}
@@ -665,7 +665,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
665665
buf = (void *)t->tx_buf;
666666
t->tx_dma = dma_map_single(&spi->dev, buf,
667667
t->len, DMA_TO_DEVICE);
668-
if (!t->tx_dma) {
668+
if (dma_mapping_error(&spi->dev, t->tx_dma)) {
669669
ret = -EFAULT;
670670
goto err_tx_map;
671671
}

0 commit comments

Comments
 (0)