Le vendredi 20 novembre 2026 à 16:13 +0100, Benjamin Gaignard a écrit : > Simplify and clean up the code by using the helpers. > > Signed-off-by: Benjamin Gaignard > Reviewed-by: Nicolas Dufresne > --- > drivers/media/platform/verisilicon/hantro_h264.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/media/platform/verisilicon/hantro_h264.c b/drivers/media/platform/verisilicon/hantro_h264.c > index 2414782f1eb6..68dde1cd1ac2 100644 > --- a/drivers/media/platform/verisilicon/hantro_h264.c > +++ b/drivers/media/platform/verisilicon/hantro_h264.c > @@ -494,26 +494,21 @@ int hantro_h264_dec_prepare_run(struct hantro_ctx *ctx) > > void hantro_h264_dec_exit(struct hantro_ctx *ctx) > { > - struct hantro_dev *vpu = ctx->dev; > struct hantro_h264_dec_hw_ctx *h264_dec = &ctx->h264_dec; > struct hantro_aux_buf *priv = &h264_dec->priv; > > - dma_free_coherent(vpu->dev, priv->size, priv->cpu, priv->dma); > + hantro_free_aux_buf(ctx, priv); > } > > int hantro_h264_dec_init(struct hantro_ctx *ctx) > { > - struct hantro_dev *vpu = ctx->dev; > struct hantro_h264_dec_hw_ctx *h264_dec = &ctx->h264_dec; > struct hantro_aux_buf *priv = &h264_dec->priv; > struct hantro_h264_dec_priv_tbl *tbl; > > - priv->cpu = dma_alloc_coherent(vpu->dev, sizeof(*tbl), &priv->dma, > - GFP_KERNEL); > - if (!priv->cpu) > + if (hantro_allocate_aux_buf(ctx, priv, sizeof(*tbl))) > return -ENOMEM; EINVAL is masked. > > - priv->size = sizeof(*tbl); > tbl = priv->cpu; > memcpy(tbl->cabac_table, h264_cabac_table, sizeof(tbl->cabac_table)); >