[PATCH v2 01/41] dmaengine: Add helper function to prep for error reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux