Thread (16 messages) flat view 16 messages, 5 authors, 10d ago

Re: [PATCH v3 3/4] dmaengine: add (dmaengine|vchan)_chan_dev() helper

From: Vinod Koul <vkoul@kernel.org>
Date: 2026-09-09 12:39:58
Also in: dmaengine, imx, linux-arm-kernel, linux-mips, linux-sunxi, linux-tegra, lkml

On 07-09-26, 10:55, Amelie Delaunay wrote:
Hi Frank,

On 9/4/26 23:49, Frank.Li@oss.nxp.com wrote:
[...]

I don't think removing chan2dev() function from the STM32 DMA drivers is an
improvement, since the parameter is a `stm32` chan, not a `dma_chan`.
chan2dev() was meant to expose the channel device behind the `stm32` wrapper
and keep logging concise.
quoted
diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c
index 3e8151e2ad75a..4688cebaf7f7a 100644
--- a/drivers/dma/stm32/stm32-dma.c
+++ b/drivers/dma/stm32/stm32-dma.c
@@ -248,11 +248,6 @@ static struct stm32_dma_desc *to_stm32_dma_desc(struct virt_dma_desc *vdesc)
  	return container_of(vdesc, struct stm32_dma_desc, vdesc);
  }
-static struct device *chan2dev(struct stm32_dma_chan *chan)
-{
-	return &chan->vchan.chan.dev->device;
-}
-
I would rather keep it as:

static struct device *chan2dev(struct stm32_dma_chan *chan)
{
	return vchan_chan_dev(&chan->vchan);
}

and then drop all further updates.
I would say better to use a common macro than keep one for yours

-- 
~Vinod
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help