diff options
-rw-r--r-- | include/asm-generic/dma-mapping-common.h | 5 | ||||
-rw-r--r-- | include/linux/dma-mapping.h | 4 |
2 files changed, 9 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, | |||
39 | debug_dma_unmap_page(dev, addr, size, dir, true); | 39 | debug_dma_unmap_page(dev, addr, size, dir, true); |
40 | } | 40 | } |
41 | 41 | ||
42 | /* | ||
43 | * dma_maps_sg_attrs returns 0 on error and > 0 on success. | ||
44 | * It should never return a value < 0. | ||
45 | */ | ||
42 | static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, | 46 | static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, |
43 | int nents, enum dma_data_direction dir, | 47 | int nents, enum dma_data_direction dir, |
44 | struct dma_attrs *attrs) | 48 | struct dma_attrs *attrs) |
@@ -51,6 +55,7 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, | |||
51 | kmemcheck_mark_initialized(sg_virt(s), s->length); | 55 | kmemcheck_mark_initialized(sg_virt(s), s->length); |
52 | BUG_ON(!valid_dma_direction(dir)); | 56 | BUG_ON(!valid_dma_direction(dir)); |
53 | ents = ops->map_sg(dev, sg, nents, dir, attrs); | 57 | ents = ops->map_sg(dev, sg, nents, dir, attrs); |
58 | BUG_ON(ents < 0); | ||
54 | debug_dma_map_sg(dev, sg, nents, ents, dir); | 59 | debug_dma_map_sg(dev, sg, nents, ents, dir); |
55 | 60 | ||
56 | return ents; | 61 | return ents; |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index c3007cb4bfa6..ac07ff090919 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -34,6 +34,10 @@ struct dma_map_ops { | |||
34 | void (*unmap_page)(struct device *dev, dma_addr_t dma_handle, | 34 | void (*unmap_page)(struct device *dev, dma_addr_t dma_handle, |
35 | size_t size, enum dma_data_direction dir, | 35 | size_t size, enum dma_data_direction dir, |
36 | struct dma_attrs *attrs); | 36 | struct dma_attrs *attrs); |
37 | /* | ||
38 | * map_sg returns 0 on error and a value > 0 on success. | ||
39 | * It should never return a value < 0. | ||
40 | */ | ||
37 | int (*map_sg)(struct device *dev, struct scatterlist *sg, | 41 | int (*map_sg)(struct device *dev, struct scatterlist *sg, |
38 | int nents, enum dma_data_direction dir, | 42 | int nents, enum dma_data_direction dir, |
39 | struct dma_attrs *attrs); | 43 | struct dma_attrs *attrs); |