Re: [PATCH 1/1] media: m2m-deinterlace: replace direct ->device_prep*() calls with standard DMA engine API

From: Frank Li

Date: Thu Sep 17 2026 - 18:11:10 EST


On Thu, Sep 17, 2026 at 11:29:31PM +0300, Laurent Pinchart wrote:
> On Thu, Sep 17, 2026 at 03:04:16PM -0400, Frank.Li@xxxxxxxxxxx wrote:
> > From: Frank Li <Frank.Li@xxxxxxx>
> >
> > DMA engine consumers must not call the channel's device_prep_*() function
> > pointers directly. Use the standard dmaengine wrapper APIs instead.
> >
> > Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
>
> I've checked the other DMA operations, and there are a few direct
> callers of .device_prep_dma_memcpy() and .device_prep_slave_sg(). The
> former should be easy to address, as the dmaengine_prep_dma_memcpy()
> wrapper is a drop-in replacement. The latter may be a bit more
> complicated.
>
> Any volunteer to send patches ? :-)

I already sent out and try to cleanup all.

Frank

>
> > ---
> > drivers/media/platform/m2m-deinterlace.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
> > index 9dcc4bd6cbdd5..57a91ff2269f2 100644
> > --- a/drivers/media/platform/m2m-deinterlace.c
> > +++ b/drivers/media/platform/m2m-deinterlace.c
> > @@ -330,7 +330,7 @@ static void deinterlace_issue_dma(struct deinterlace_ctx *ctx, int op,
> > ctx->xt->dst_sgl = true;
> > flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
> >
> > - tx = dmadev->device_prep_interleaved_dma(chan, ctx->xt, flags);
> > + tx = dmaengine_prep_interleaved_dma(chan, ctx->xt, flags);
> > if (tx == NULL) {
> > v4l2_warn(&pcdev->v4l2_dev, "DMA interleaved prep error\n");
> > return;
>
> --
> Regards,
>
> Laurent Pinchart