DMA Engine development
 help / color / mirror / Atom feed
* [PATCH 1/1] dmaengine: move driver-private helpers out of include/linux/dmaengine.h
@ 2026-10-01 14:39 Frank.Li
  2026-10-09 10:15 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Frank.Li @ 2026-10-01 14:39 UTC (permalink / raw)
  To: Vinod Koul, Frank Li, Viresh Kumar, Andy Shevchenko,
	open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM, open list
  Cc: imx, Frank Li

From: Frank Li <Frank.Li@nxp.com>

Move the following functions and declarations from the public header
include/linux/dmaengine.h into the driver-private header
drivers/dma/dmaengine.h, since they are only used by DMA engine drivers
and not by DMA engine consumers:

  - dma_async_device_register()
  - dmaenginem_async_device_register()
  - dma_async_device_unregister()
  - dma_async_device_channel_register()
  - dma_async_device_channel_unregister()
  - is_slave_direction()
  - dmaengine_get_direction_text()

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/dma/dmaengine.h   | 32 ++++++++++++++++++++++++++++++++
 drivers/dma/dw/dw.c       |  1 +
 include/linux/dmaengine.h | 31 -------------------------------
 3 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
index 53f16d3f00294..42a3cfa7e5970 100644
--- a/drivers/dma/dmaengine.h
+++ b/drivers/dma/dmaengine.h
@@ -182,6 +182,38 @@ dmaengine_desc_callback_valid(struct dmaengine_desc_callback *cb)
 struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
 struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
 
+static inline char *
+dmaengine_get_direction_text(enum dma_transfer_direction dir)
+{
+	switch (dir) {
+	case DMA_DEV_TO_MEM:
+		return "DEV_TO_MEM";
+	case DMA_MEM_TO_DEV:
+		return "MEM_TO_DEV";
+	case DMA_MEM_TO_MEM:
+		return "MEM_TO_MEM";
+	case DMA_DEV_TO_DEV:
+		return "DEV_TO_DEV";
+	default:
+		return "invalid";
+	}
+}
+
+static inline bool is_slave_direction(enum dma_transfer_direction direction)
+{
+	return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM) ||
+	       (direction == DMA_DEV_TO_DEV);
+}
+
+int dma_async_device_register(struct dma_device *device);
+int dmaenginem_async_device_register(struct dma_device *device);
+void dma_async_device_unregister(struct dma_device *device);
+int dma_async_device_channel_register(struct dma_device *device,
+				      struct dma_chan *chan,
+				      const char *name);
+void dma_async_device_channel_unregister(struct dma_device *device,
+					 struct dma_chan *chan);
+
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
 
diff --git a/drivers/dma/dw/dw.c b/drivers/dma/dw/dw.c
index 6766142884b66..e56974e7d4afb 100644
--- a/drivers/dma/dw/dw.c
+++ b/drivers/dma/dw/dw.c
@@ -9,6 +9,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
+#include "../dmaengine.h"
 #include "internal.h"
 
 static void dw_dma_initialize_chan(struct dw_dma_chan *dwc)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 1b57bc4a7e72a..3203b5f81b21d 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -989,12 +989,6 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
 	return -ENOSYS;
 }
 
-static inline bool is_slave_direction(enum dma_transfer_direction direction)
-{
-	return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM) ||
-	       (direction == DMA_DEV_TO_DEV);
-}
-
 static inline struct dma_async_tx_descriptor *
 dmaengine_prep_config_single(struct dma_chan *chan, dma_addr_t buf, size_t len,
 			     enum dma_transfer_direction dir,
@@ -1756,14 +1750,6 @@ static inline int dmaengine_desc_free(struct dma_async_tx_descriptor *desc)
 
 /* --- DMA device --- */
 
-int dma_async_device_register(struct dma_device *device);
-int dmaenginem_async_device_register(struct dma_device *device);
-void dma_async_device_unregister(struct dma_device *device);
-int dma_async_device_channel_register(struct dma_device *device,
-				      struct dma_chan *chan,
-				      const char *name);
-void dma_async_device_channel_unregister(struct dma_device *device,
-					 struct dma_chan *chan);
 void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
 #define dma_request_channel(mask, x, y) \
 	__dma_request_channel(&(mask), x, y, NULL)
@@ -1785,23 +1771,6 @@ static inline struct dma_chan
 	return dma_request_channel(mask, fn, fn_param);
 }
 
-static inline char *
-dmaengine_get_direction_text(enum dma_transfer_direction dir)
-{
-	switch (dir) {
-	case DMA_DEV_TO_MEM:
-		return "DEV_TO_MEM";
-	case DMA_MEM_TO_DEV:
-		return "MEM_TO_DEV";
-	case DMA_MEM_TO_MEM:
-		return "MEM_TO_MEM";
-	case DMA_DEV_TO_DEV:
-		return "DEV_TO_DEV";
-	default:
-		return "invalid";
-	}
-}
-
 static inline struct device *dmaengine_chan_dev(struct dma_chan *chan)
 {
 	return &chan->chan_dev->device;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] dmaengine: move driver-private helpers out of include/linux/dmaengine.h
  2026-10-01 14:39 [PATCH 1/1] dmaengine: move driver-private helpers out of include/linux/dmaengine.h Frank.Li
@ 2026-10-09 10:15 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2026-10-09 10:15 UTC (permalink / raw)
  To: Frank Li, Viresh Kumar, Andy Shevchenko, dmaengine, linux-kernel,
	Frank.Li
  Cc: imx, Frank Li


On Thu, 01 Oct 2026 10:39:53 -0400, Frank.Li@oss.nxp.com wrote:
> Move the following functions and declarations from the public header
> include/linux/dmaengine.h into the driver-private header
> drivers/dma/dmaengine.h, since they are only used by DMA engine drivers
> and not by DMA engine consumers:
> 
>   - dma_async_device_register()
>   - dmaenginem_async_device_register()
>   - dma_async_device_unregister()
>   - dma_async_device_channel_register()
>   - dma_async_device_channel_unregister()
>   - is_slave_direction()
>   - dmaengine_get_direction_text()
> 
> [...]

Applied, thanks!

[1/1] dmaengine: move driver-private helpers out of include/linux/dmaengine.h
      commit: 511afae96d89847f753fcab6b3a597f0281be9d5

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-09 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 14:39 [PATCH 1/1] dmaengine: move driver-private helpers out of include/linux/dmaengine.h Frank.Li
2026-10-09 10:15 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox