Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aabb797b authored by Kevin Hilman's avatar Kevin Hilman Committed by Greg Kroah-Hartman
Browse files

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: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c32462d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -646,7 +646,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
			buf = t->rx_buf;
		t->rx_dma = dma_map_single(&spi->dev, buf,
				t->len, DMA_FROM_DEVICE);
		if (!t->rx_dma) {
		if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
			ret = -EFAULT;
			goto err_rx_map;
		}
@@ -660,7 +660,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
			buf = (void *)t->tx_buf;
		t->tx_dma = dma_map_single(&spi->dev, buf,
				t->len, DMA_TO_DEVICE);
		if (!t->tx_dma) {
		if (dma_mapping_error(&spi->dev, t->tx_dma)) {
			ret = -EFAULT;
			goto err_tx_map;
		}