DMA移植时发现DMA_SG消失了

DMA_SG消失了

在对内核4.4->5.10版本DMA的移植时,发现DMA驱动里有一个DMA_SG的枚举被删去.

这对于移植来说带来了很大的麻烦.最坏的情况是,这个枚举消失了,但是合并到其他枚举的功能实现里去了.
然后我就去查找在哪一个版本有对这个枚举有改动.最终在这个版本里发现该枚举被移除了

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99

authorDave Jiang dave.jiang@intel.com2017-08-21 10:23:13 -0700
committerVinod Koul vinod.koul@intel.com2017-08-22 09:22:11 +0530
commithttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99 (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/include/linux/dmaengine.h?id=c678fa66341c7b82a57cfed0ba3656162e970f99)
treehttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99 /https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99
parenthttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=61b5f54d8c1fafb97dace958a54cdd72b37138c3 (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99&id2=61b5f54d8c1fafb97dace958a54cdd72b37138c3)
downloadhttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-c678fa66341c7b82a57cfed0ba3656162e970f99.tar.gz
dmaengine: remove DMA_SG as it is dead code in kernel
There are no in kernel consumers for DMA_SG op. Removing operation,
dead code, and test code in dmatest.

Signed-off-by: Dave Jiang 
Reviewed-by: Linus Walleij 
Cc: Gary Hook 
Cc: Ludovic Desroches 
Cc: Kedareswara rao Appana 
Cc: Li Yang 
Cc: Michal Simek 
Signed-off-by: Vinod Koul 


diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 533680860865a..64fbd380c4309 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -68,7 +68,6 @@ enum dma_transaction_type {
     DMA_MEMSET,
     DMA_MEMSET_SG,
     DMA_INTERRUPT,
-    DMA_SG,
     DMA_PRIVATE,
     DMA_ASYNC_TX,
     DMA_SLAVE,
@@ -771,11 +770,6 @@ struct dma_device {
         unsigned int nents, int value, unsigned long flags);
     struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
         struct dma_chan *chan, unsigned long flags);
-    struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
-        struct dma_chan *chan,
-        struct scatterlist *dst_sg, unsigned int dst_nents,
-        struct scatterlist *src_sg, unsigned int src_nents,
-        unsigned long flags);
 
     struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
         struct dma_chan *chan, struct scatterlist *sgl,
@@ -905,19 +899,6 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memcpy(
                             len, flags);
 }
 
-static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
-        struct dma_chan *chan,
-        struct scatterlist *dst_sg, unsigned int dst_nents,
-        struct scatterlist *src_sg, unsigned int src_nents,
-        unsigned long flags)
-{
-    if (!chan || !chan->device || !chan->device->device_prep_dma_sg)
-        return NULL;
-
-    return chan->device->device_prep_dma_sg(chan, dst_sg, dst_nents,
-            src_sg, src_nents, flags);
-}
-
 /**
  * dmaengine_terminate_all() - Terminate all active DMA transfers
  * @chan: The channel for which to terminate the transfers

dmaengine: remove DMA_SG as it is dead code in kernel
There are no in kernel consumers for DMA_SG op. Removing operation,
dead code, and test code in dmatest.

翻译成中文

dmaengine:删除DMA_SG,因为它是内核中的死代码

DMA_SG操作的内核内没有使用者。删除操作,死代码和dmatest中的测试代码。

通过此只知道被删去了,不知道其他属于DMA_SG的部分去了哪里.

所以想问一下DMA_SG这个宏为什么可以直接删除