linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Yu Kuai <yukuai3@huawei.com>,
	rick.chang@mediatek.com, bin.liu@mediatek.com,
	mchehab@kernel.org, matthias.bgg@gmail.com,
	tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com,
	tfiga@chromium.org, xia.jiang@mediatek.com, jcliang@chromium.org,
	minghsiu.tsai@mediatek.com
Cc: yi.zhang@huawei.com, linux-mediatek@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe()
Date: Fri, 30 Oct 2020 10:46:45 +0100	[thread overview]
Message-ID: <4644b6ca-ecc9-191f-c335-9c6d692ef38c@xs4all.nl> (raw)
In-Reply-To: <20201009123804.3977562-3-yukuai3@huawei.com>

On 09/10/2020 14:37, Yu Kuai wrote:
> if mtk_jpeg_clk_init() succeed, mtk_jpeg_probe() doesn't have a
> corresponding put_device(). Thus add put_device() in jump target to fix
> the exception handling for this function implementation.
> 
> Fixes: b2f0d2724ba4 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> index 106543391c46..f0c412f96d61 100644
> --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> @@ -1436,6 +1436,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
>  	v4l2_device_unregister(&jpeg->v4l2_dev);
>  
>  err_dev_register:
> +	put_device(jpeg->larb);
>  
>  err_clk_init:
>  
> 

This is too confusing since it is not obvious that this is the
counterpart of mtk_jpeg_clk_init. I think it would be much easier
to understand if you add a mtk_jpeg_clk_release() which does this
put_device, and call that new function both here and in mtk_jpeg_remove().

Regards,

	Hans

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-10-30  9:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
2020-10-09 12:37 ` [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init() Yu Kuai
2020-10-09 12:37 ` [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe() Yu Kuai
2020-10-30  9:46   ` Hans Verkuil [this message]
2020-10-09 12:38 ` [PATCH 3/7] media: platform: add missing put_device() call in mtk_jpeg_remove() Yu Kuai
2020-10-09 12:38 ` [PATCH 4/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 5/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 6/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 7/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_enc_pm() Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4644b6ca-ecc9-191f-c335-9c6d692ef38c@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=bin.liu@mediatek.com \
    --cc=jcliang@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=rick.chang@mediatek.com \
    --cc=tfiga@chromium.org \
    --cc=tiffany.lin@mediatek.com \
    --cc=xia.jiang@mediatek.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).