Adding dmaengine core helper function in order to prep for error reporting. Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx> --- include/linux/dmaengine.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 30de019..95cf217 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1372,6 +1372,27 @@ static inline int dmaengine_desc_free(struct dma_async_tx_descriptor *desc) return -EPERM; } +struct dmaengine_desc_callback { + dma_async_tx_callback callback; + void *callback_param; +}; + +static inline void +dmaengine_desc_get_callback(struct dma_async_tx_descriptor *tx, + struct dmaengine_desc_callback *cb) +{ + cb->callback = tx->callback; + cb->callback_param = tx->callback_param; +} + +static inline void +dmaengine_desc_callback_invoke(struct dmaengine_desc_callback *cb, + void *result) +{ + if (cb->callback) + cb->callback(cb->callback_param); +} + /* --- DMA device --- */ int dma_async_device_register(struct dma_device *device); -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html