[PATCH v2 2/2] media: mediatek: amend vpu_get_plat_device() documentation

Johan Hovold johan at kernel.org
Tue Dec 9 19:21:03 PST 2025


On Tue, Dec 09, 2025 at 03:43:30PM -0500, Nicolas Dufresne wrote:
> Hi,
> 
> Le mardi 28 octobre 2025 à 11:04 +0100, Johan Hovold a écrit :
> > Add a comment to the vpu_get_plat_device() documentation to make it
> > clear that the VPU platform device is returned with an incremented
> > reference count (which needs to be dropped after use).
> > 
> > Signed-off-by: Johan Hovold <johan at kernel.org>
> > ---
> >  drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.h b/drivers/media/platform/mediatek/vpu/mtk_vpu.h
> > index da05f3e74081..5808311d2b15 100644
> > --- a/drivers/media/platform/mediatek/vpu/mtk_vpu.h
> > +++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.h
> > @@ -120,7 +120,7 @@ int vpu_ipi_send(struct platform_device *pdev,
> >   *		device for using VPU API.
> >   *
> >   * Return: Return NULL if it is failed.
> > - * otherwise it is VPU's platform device
> > + * otherwise it is VPU's platform device with incremented reference count
> 
> I picked this patch but rewrote with what felt like better and dense.
> 
> - * Return: Return NULL if it is failed.
> - * otherwise it is VPU's platform device
> + * Return: a reference to the VPU's platform device, or NULL on failure.
> 
> hope its ok with you,

Sure, my only concern is that just saying "reference" is too subtle,
that's why I explicitly mentioned the refcount.

Btw, why is patch 2/2 marked obsolete? That leak is still there both on
probe errors (which I saw someone else posted a fix for) and on driver
unbind.

Johan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20251210/40c59854/attachment.sig>


More information about the Linux-mediatek mailing list