Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: "chenjiahao (C)" <chenjiahao16@huawei.com>
To: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>,
	<andersson@kernel.org>, <mathieu.poirier@linaro.org>,
	<mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH -next] remoteproc: stm32: Clean up redundant dev_err_probe()
Date: Thu, 17 Aug 2023 10:33:12 +0800	[thread overview]
Message-ID: <97ed3bff-424c-3df3-47ed-e74c34412813@huawei.com> (raw)
In-Reply-To: <15e381f6-aabd-8a3a-7911-4e64828b0fdc@foss.st.com>


On 2023/8/16 20:46, Arnaud POULIQUEN wrote:
> Hi,
>
> On 8/2/23 11:51, Chen Jiahao wrote:
>> Referring to platform_get_irq()'s definition, the return value has
>> already been checked if ret < 0, and printed via dev_err_probe().
>> Calling dev_err_probe() one more time outside platform_get_irq()
>> is obviously redundant.
>>
>> Removing dev_err_probe() outside platform_get_irq() to clean up
>> above problem.
>>
>> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
>> ---
>>   drivers/remoteproc/stm32_rproc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
>> index 98234b44f038..a09eeb83ea5c 100644
>> --- a/drivers/remoteproc/stm32_rproc.c
>> +++ b/drivers/remoteproc/stm32_rproc.c
>> @@ -714,7 +714,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
>>   
>>   	irq = platform_get_irq(pdev, 0);
>>   	if (irq == -EPROBE_DEFER)
>> -		return dev_err_probe(dev, irq, "failed to get interrupt\n");
>> +		return irq;
> The IRQ is optional so using platform_get_irq_optional seems a better option to me.
>
> -  	irq = platform_get_irq(pdev, 0);
> +  	irq = platform_get_irq_optional(pdev, 0);

Hi,

Thanks for your reminding.

It seems that platform_get_irq is nothing more than platform_get_irq_optional,
except wrapping a dev_err_probe for error code checking. So using the former
one should also be OK.

Or have I missed anywhere else?

Best Regards,
Jiahao

>>   	if (irq == -EPROBE_DEFER)
>> 		return dev_err_probe(dev, irq, "failed to get interrupt\n");
> Thanks,
> Arnaud
>
>>   
>>   	if (irq > 0) {
>>   		err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,

  reply	other threads:[~2023-08-17  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  9:51 [PATCH -next] remoteproc: stm32: Clean up redundant dev_err_probe() Chen Jiahao
2023-08-16 12:46 ` Arnaud POULIQUEN
2023-08-17  2:33   ` chenjiahao (C) [this message]
2023-08-17  7:02     ` Arnaud POULIQUEN
2023-08-17  8:20       ` chenjiahao (C)

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=97ed3bff-424c-3df3-47ed-e74c34412813@huawei.com \
    --to=chenjiahao16@huawei.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.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