Documentation: DMA API: Be more explicit that nents is always the same
authorSakari Ailus <sakari.ailus@iki.fi>
Wed, 23 Sep 2015 11:41:09 +0000 (14:41 +0300)
committerJonathan Corbet <corbet@lwn.net>
Thu, 24 Sep 2015 21:50:06 +0000 (15:50 -0600)
The nents argument to the DMA API functions operating on scatterlists is
always the same. The documentation used different argument names and the
matter was not mentioned in Documentation/DMA-API-HOWTO.txt at all. Fix
these.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/DMA-API-HOWTO.txt
Documentation/DMA-API.txt

index 55b70b903ead2e95ce1226ef0fec3612bea67189..d69b3fc64e14e0427717efc5c505231c78acb5a6 100644 (file)
@@ -681,6 +681,11 @@ or:
 
 as appropriate.
 
+PLEASE NOTE:  The 'nents' argument to dma_sync_sg_for_cpu() and
+             dma_sync_sg_for_device() must be the same passed to
+             dma_map_sg(). It is _NOT_ the count returned by
+             dma_map_sg().
+
 After the last DMA transfer call one of the DMA unmap routines
 dma_unmap_{single,sg}(). If you don't touch the data from the first
 dma_map_*() call till dma_unmap_*(), then you don't have to call the
index edccacd4f048a13e8afdb63db7d98ad41667a503..8d065d6ec956b5b5db47400fb4f72d2f8fad390e 100644 (file)
@@ -340,7 +340,7 @@ accessed sg->address and sg->length as shown above.
 
        void
        dma_unmap_sg(struct device *dev, struct scatterlist *sg,
-               int nhwentries, enum dma_data_direction direction)
+               int nents, enum dma_data_direction direction)
 
 Unmap the previously mapped scatter/gather list.  All the parameters
 must be the same as those and passed in to the scatter/gather mapping
@@ -356,10 +356,10 @@ void
 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
                           enum dma_data_direction direction)
 void
-dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
                    enum dma_data_direction direction)
 void
-dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
                       enum dma_data_direction direction)
 
 Synchronise a single contiguous or scatter/gather mapping for the CPU