]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
firmware/ivc: use dma_mapping_error
authorChristoph Hellwig <hch@lst.de>
Sun, 21 May 2017 10:33:39 +0000 (12:33 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 20 Jun 2017 09:12:54 +0000 (11:12 +0200)
DMA_ERROR_CODE is not supposed to be used by drivers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/ivc.c

index 29ecfd81532013ccf03053056c613e427716bf28..a01461d63f6851cbf80f9c015b89280f18bda6dc 100644 (file)
@@ -646,12 +646,12 @@ int tegra_ivc_init(struct tegra_ivc *ivc, struct device *peer, void *rx,
        if (peer) {
                ivc->rx.phys = dma_map_single(peer, rx, queue_size,
                                              DMA_BIDIRECTIONAL);
-               if (ivc->rx.phys == DMA_ERROR_CODE)
+               if (dma_mapping_error(peer, ivc->rx.phys))
                        return -ENOMEM;
 
                ivc->tx.phys = dma_map_single(peer, tx, queue_size,
                                              DMA_BIDIRECTIONAL);
-               if (ivc->tx.phys == DMA_ERROR_CODE) {
+               if (dma_mapping_error(peer, ivc->tx.phys)) {
                        dma_unmap_single(peer, ivc->rx.phys, queue_size,
                                         DMA_BIDIRECTIONAL);
                        return -ENOMEM;