summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 01:50:27 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 01:50:27 +0300
commiteabbfdecdae4413687a36fd17c3e98de59ba492b (patch)
treed8d947b4d0a3a5722221d27b0150571bb1e68aa1 /include/asm-generic
parent45701e2636a02ab1c5305ead5236f05bda64c15f (diff)
parent04abab698285297115e5096b3100df1064045529 (diff)
downloadlinux-eabbfdecdae4413687a36fd17c3e98de59ba492b.tar.xz
Merge branch 'for-v4.1-rc1' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull DMA-mapping updates from Marek Szyprowski: "This contains two patches, which clarify abiguity in the dma-mapping api" * 'for-v4.1-rc1' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: include/dma-mapping: Clarify output of dma_map_sg asm/dma-mapping-common: Clarify output of dma_map_sg_attrs
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/dma-mapping-common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 3378dcf4c31e..940d5ec122c9 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -39,6 +39,10 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
debug_dma_unmap_page(dev, addr, size, dir, true);
}
+/*
+ * dma_maps_sg_attrs returns 0 on error and > 0 on success.
+ * It should never return a value < 0.
+ */
static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
int nents, enum dma_data_direction dir,
struct dma_attrs *attrs)
@@ -51,6 +55,7 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
kmemcheck_mark_initialized(sg_virt(s), s->length);
BUG_ON(!valid_dma_direction(dir));
ents = ops->map_sg(dev, sg, nents, dir, attrs);
+ BUG_ON(ents < 0);
debug_dma_map_sg(dev, sg, nents, ents, dir);
return ents;