summaryrefslogtreecommitdiff
path: root/kernel/dma/direct.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2021-07-29 23:15:20 +0300
committerChristoph Hellwig <hch@lst.de>2021-08-09 18:13:04 +0300
commitc81be74e7d790f090d3c8a52e20a334dc2506a3f (patch)
treee7b9a8a703e6487d4c4e12f5475aba3683a4b4c2 /kernel/dma/direct.c
parentfffe3cc8c2194f60c4af4fac7f27d25e8828f001 (diff)
downloadlinux-c81be74e7d790f090d3c8a52e20a334dc2506a3f.tar.xz
dma-direct: return appropriate error code from dma_direct_map_sg()
Now that the map_sg() op expects error codes instead of return zero on error, convert dma_direct_map_sg() to return an error code. Per the documentation for dma_map_sgtable(), -EIO is returned due to an DMA_MAPPING_ERROR with unknown cause. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma/direct.c')
-rw-r--r--kernel/dma/direct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index f737e3347059..f33ceb68aef2 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -411,7 +411,7 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
out_unmap:
dma_direct_unmap_sg(dev, sgl, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC);
- return 0;
+ return -EIO;
}
dma_addr_t dma_direct_map_resource(struct device *dev, phys_addr_t paddr,