diff --git a/drivers/dma-buf/dma-buf-io.c b/drivers/dma-buf/dma-buf-io.c index 21296bd3dde1..e432194a5dfc 100644 --- a/drivers/dma-buf/dma-buf-io.c +++ b/drivers/dma-buf/dma-buf-io.c @@ -106,7 +106,7 @@ static struct dma_buf_io_map *__dma_buf_io_create_map(struct dma_buf_io_ctx *ctx * @ctx: [in] dma-buf I/O context * * A slow path part of dma_buf_io_get_map() and shouldn't be used directly. - * Behaves in the same way but allowed to block. + * Behaves in the same way but is allowed to block. * * Returns a map on success, or ERR_PTR encoded errno otherwise. */ @@ -133,16 +133,16 @@ static void dma_buf_io_ctx_shutdown(struct dma_buf_io_ctx *ctx) } /* - * dma_buf_io_ctx_create - create a new dma-buf I/O context for the given file. + * dma_buf_io_ctx_create - Create a new dma-buf I/O context for the given file. * @file: [in] file for which the context is created * @dmabuf: [in] buffer to create a context from * @dir: [in] direction of DMA transfers - * @out_ctx [out] resulting ctx + * @out_ctx: [out] resulting ctx * * Create a new I/O context from the given DMA buffer for the given file. * It only works with files implementing ->init_dma_buf_io_ctx and fails * with -EOPNOTSUPP otherwise. Once created, the user can create a map - * and use it to issue I/O like read / write requests to @file. + * and use it to issue I/O, such as read/write requests, to @file. */ int dma_buf_io_ctx_create(struct file *file, struct dma_buf *dmabuf, @@ -180,7 +180,7 @@ int dma_buf_io_ctx_create(struct file *file, } /** - * dma_buf_io_ctx_release - destroy the I/O context + * dma_buf_io_ctx_release - Destroy the I/O context * @ctx: [in] dma-buf I/O context * * Destroy the context. It makes sure all maps are waited on and destroyed, @@ -201,11 +201,11 @@ void dma_buf_io_ctx_release(struct dma_buf_io_ctx *ctx) } /** - * dma_buf_io_invalidate_mappings - invalidate the current map + * dma_buf_io_invalidate_mappings - Invalidate the current map * @ctx: [in] dma-buf I/O context * * Importer's helper for invalidating the current map. Waits for all I/O - * using the map to complete and destroyes the map. Called with the + * using the map to complete and destroys the map. Called with the * dma-buf reservation lock held. */ void dma_buf_io_invalidate_mappings(struct dma_buf_io_ctx *ctx) @@ -215,11 +215,11 @@ void dma_buf_io_invalidate_mappings(struct dma_buf_io_ctx *ctx) EXPORT_SYMBOL_NS_GPL(dma_buf_io_invalidate_mappings, "DMA_BUF"); /** - * dma_buf_io_detach - detach the @ctx from the importer. + * dma_buf_io_detach - Detach the @ctx from the importer. * @ctx: [in] dma-buf I/O context * - * Importer's helper for removing the I/O ctx. It kills all maps and - * prevents creation of new ones. Upon return it's safe for the importer + * Importer's helper for removing the I/O context. It kills all maps and + * prevents creation of new ones. Upon return, it's safe for the importer * to release all its resources such as dma-buf attachments. */ void dma_buf_io_detach(struct dma_buf_io_ctx *ctx) diff --git a/include/linux/dma-buf-io.h b/include/linux/dma-buf-io.h index b9bbeca1744f..d9f27650a851 100644 --- a/include/linux/dma-buf-io.h +++ b/include/linux/dma-buf-io.h @@ -60,6 +60,7 @@ void dma_buf_io_ctx_release(struct dma_buf_io_ctx *ctx); struct dma_buf_io_map *dma_buf_io_create_map(struct dma_buf_io_ctx *ctx); +/* Internal helper, see dma_buf_io_get_map() */ static inline struct dma_buf_io_map * __dma_buf_io_get_map(struct dma_buf_io_ctx *ctx) { @@ -79,10 +80,10 @@ __dma_buf_io_get_map(struct dma_buf_io_ctx *ctx) * @ctx: [in] dma-buf I/O context * @nowait: [in] specifies whether it's allowed to block * - * Create a new or acquire an existing map. When succeeds, it returns + * Create a new or acquire an existing map. On success, it returns * a referenced map, which should eventually be put down with * dma_buf_io_map_drop(). If @nowait is set and the function would block, - * it return -EAGAIN, and the caller is expected to retry from a context + * it returns -EAGAIN, and the caller is expected to retry from a context * where blocking is allowed. * * Returns a map on success, or ERR_PTR encoded errno otherwise. @@ -105,7 +106,7 @@ dma_buf_io_get_map(struct dma_buf_io_ctx *ctx, bool nowait) * dma_buf_io_map_drop - Drop the map. * @map: [in] dma-buf I/O map * - * Put down a reference for the @map acquired via dma_buf_io_get_map(). + * Put down a reference to the @map acquired via dma_buf_io_get_map(). * Should be called as soon as I/O is completed. */ static inline void dma_buf_io_map_drop(struct dma_buf_io_map *map)