diff options
author | ian <ian@FreeBSD.org> | 2013-02-16 20:43:16 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2013-02-16 20:43:16 +0000 |
commit | 810f5b61cd6892e116965646c4996e0a30289f1b (patch) | |
tree | ff89f9b82fc661a8a6c8c5ca9de3098a3c743a81 /sys/arm | |
parent | c19ac081a36f6c6906ce8651b26fa46f0db5193a (diff) | |
download | FreeBSD-src-810f5b61cd6892e116965646c4996e0a30289f1b.zip FreeBSD-src-810f5b61cd6892e116965646c4996e0a30289f1b.tar.gz |
In _bus_dmamap_addseg(), the return value must be zero for error, or the size
actually added to the segment (possibly smaller than the requested size if
boundary crossings had to be avoided).
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/busdma_machdep-v6.c | 2 | ||||
-rw-r--r-- | sys/arm/arm/busdma_machdep.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 1ac2c97..c87f857 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -856,7 +856,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, curaddr); if (dr == NULL) { _bus_dmamap_unload(dmat, map); - return (EINVAL); + return (0); } /* * In a valid DMA range. Translate the physical diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index f31a7fe..10760b4 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -913,7 +913,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, curaddr); if (dr == NULL) - return (EINVAL); + return (0); /* * In a valid DMA range. Translate the physical * memory address to an address in the DMA window. @@ -935,12 +935,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, segs[seg].ds_len += sgsize; } else { if (++seg >= dmat->nsegments) - return (EFBIG); + return (0); segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; } *segp = seg; - return (0); + return (sgsize); } /* |