dmaengine: provide dummy functions for DMA_ENGINE=n [Linux 2.6.37]

This Linux kernel change "dmaengine: provide dummy functions for DMA_ENGINE=n" is included in the Linux 2.6.37 release. This change is authored by Guennadi Liakhovetski <g.liakhovetski [at] gmx.de> on Wed Dec 22 14:46:46 2010 +0100. The commit for this change in Linux stable tree is 8f33d52 (patch).

dmaengine: provide dummy functions for DMA_ENGINE=n

This lets drivers, optionally using the dmaengine, build with DMA_ENGINE
unselected.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Dan Williams <[email protected]>

There are 13 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 include/linux/dmaengine.h | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 9d8688b..8cd00ad 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -824,6 +824,8 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
 #ifdef CONFIG_DMA_ENGINE
 enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
 void dma_issue_pending_all(void);
+struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
+void dma_release_channel(struct dma_chan *chan);
 #else
 static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
 {
@@ -831,7 +833,14 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript
 }
 static inline void dma_issue_pending_all(void)
 {
-   do { } while (0);
+}
+static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask,
+                         dma_filter_fn fn, void *fn_param)
+{
+   return NULL;
+}
+static inline void dma_release_channel(struct dma_chan *chan)
+{
 }
 #endif

@@ -842,8 +851,6 @@ static inline void dma_issue_pending_all(void)
 void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
 struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
 #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
-struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
-void dma_release_channel(struct dma_chan *chan);

 /* --- Helper iov-locking functions --- */

Leave a Reply

Your email address will not be published. Required fields are marked *