Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: "Fei Shao" <fshao@chromium.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Chen-Yu Tsai" <wenst@chromium.org>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	Yunfei Dong <yunfei.dong@mediatek.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2] media: mediatek: vcodec: mtk_vcodec_dec_hw: Use devm_pm_runtime_enable()
Date: Tue, 23 May 2023 14:28:28 +0200	[thread overview]
Message-ID: <2f1bf798-49c3-13d7-96e5-b29e7df73bd1@xs4all.nl> (raw)
In-Reply-To: <b5799dfe-f17b-a838-0916-645ba83307d2@xs4all.nl>

On 23/05/2023 13:42, Hans Verkuil wrote:
> On 15/05/2023 08:16, Fei Shao wrote:
>> Convert pm_runtime_enable() to the managed version, and clean up error
>> handling and unnecessary .remove() callback accordingly.
> 
> This patch no longer applies. Can you make a v3?

Sorry, you can ignore this. I now realize that this was a v2 of

https://patchwork.linuxtv.org/project/linux-media/patch/20230510233117.1.I7047714f92ef7569bd21f118ae6aee20b3175a92@changeid/

I had that v1 applied, so obviously this v2 would fail to apply. After dropping
that v1 patch it now applies cleanly.

Regards,

	Hans

> 
> Regards,
> 
> 	Hans
> 
>>
>> Signed-off-by: Fei Shao <fshao@chromium.org>
>>
>> ---
>>
>> Changes in v2:
>> Use devm_pm_runtime_enable() per suggestion from the previous thread:
>> https://lore.kernel.org/lkml/20230510164330.z2ygkl7vws6fci75@pengutronix.de/T/#m25be91afe3e9554600e859a8a59128ca234fc63d
>>
>>  .../mediatek/vcodec/mtk_vcodec_dec_hw.c       | 26 ++++++-------------
>>  1 file changed, 8 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>> index b753bf54ebd9..e1cb2f8dca33 100644
>> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
>> @@ -148,20 +148,21 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)
>>  	ret = mtk_vcodec_init_dec_clk(pdev, &subdev_dev->pm);
>>  	if (ret)
>>  		return ret;
>> -	pm_runtime_enable(&pdev->dev);
>> +
>> +	ret = devm_pm_runtime_enable(&pdev->dev);
>> +	if (ret)
>> +		return ret;
>>  
>>  	of_id = of_match_device(mtk_vdec_hw_match, dev);
>>  	if (!of_id) {
>>  		dev_err(dev, "Can't get vdec subdev id.\n");
>> -		ret = -EINVAL;
>> -		goto err;
>> +		return -EINVAL;
>>  	}
>>  
>>  	hw_idx = (enum mtk_vdec_hw_id)(uintptr_t)of_id->data;
>>  	if (hw_idx >= MTK_VDEC_HW_MAX) {
>>  		dev_err(dev, "Hardware index %d not correct.\n", hw_idx);
>> -		ret = -EINVAL;
>> -		goto err;
>> +		return -EINVAL;
>>  	}
>>  
>>  	main_dev->subdev_dev[hw_idx] = subdev_dev;
>> @@ -173,36 +174,25 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)
>>  	if (IS_SUPPORT_VDEC_HW_IRQ(hw_idx)) {
>>  		ret = mtk_vdec_hw_init_irq(subdev_dev);
>>  		if (ret)
>> -			goto err;
>> +			return ret;
>>  	}
>>  
>>  	subdev_dev->reg_base[VDEC_HW_MISC] =
>>  		devm_platform_ioremap_resource(pdev, 0);
>>  	if (IS_ERR((__force void *)subdev_dev->reg_base[VDEC_HW_MISC])) {
>>  		ret = PTR_ERR((__force void *)subdev_dev->reg_base[VDEC_HW_MISC]);
>> -		goto err;
>> +		return ret;
>>  	}
>>  
>>  	if (!main_dev->subdev_prob_done)
>>  		main_dev->subdev_prob_done = mtk_vdec_hw_prob_done;
>>  
>>  	platform_set_drvdata(pdev, subdev_dev);
>> -	return 0;
>> -err:
>> -	pm_runtime_disable(subdev_dev->pm.dev);
>> -	return ret;
>> -}
>> -
>> -static int mtk_vdec_hw_remove(struct platform_device *pdev)
>> -{
>> -	pm_runtime_disable(&pdev->dev);
>> -
>>  	return 0;
>>  }
>>  
>>  static struct platform_driver mtk_vdec_driver = {
>>  	.probe	= mtk_vdec_hw_probe,
>> -	.remove = mtk_vdec_hw_remove,
>>  	.driver	= {
>>  		.name	= "mtk-vdec-comp",
>>  		.of_match_table = mtk_vdec_hw_match,
> 



  reply	other threads:[~2023-05-23 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  6:16 [PATCH v2] media: mediatek: vcodec: mtk_vcodec_dec_hw: Use devm_pm_runtime_enable() Fei Shao
2023-05-23 11:42 ` Hans Verkuil
2023-05-23 12:28   ` Hans Verkuil [this message]
2023-05-23 15:18     ` Fei Shao
2023-05-23 15:22       ` Hans Verkuil
2023-05-23 12:10 ` Alexandre Mergnat
2023-05-23 15:14 ` AngeloGioacchino Del Regno

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=2f1bf798-49c3-13d7-96e5-b29e7df73bd1@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=fshao@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=tiffany.lin@mediatek.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wenst@chromium.org \
    --cc=yunfei.dong@mediatek.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