* [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe()
@ 2023-08-17 8:33 Chen Jiahao
2023-08-30 12:36 ` [Linux-stm32] " Arnaud POULIQUEN
2023-09-13 16:24 ` Mathieu Poirier
0 siblings, 2 replies; 3+ messages in thread
From: Chen Jiahao @ 2023-08-17 8:33 UTC (permalink / raw)
To: andersson, mathieu.poirier, mcoquelin.stm32, alexandre.torgue,
linux-remoteproc, linux-stm32, linux-arm-kernel, arnaud.pouliquen
Cc: chenjiahao16
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 outside dev_err_probe() to
clean it up.
Besides, switch to use platform_get_irq_optional() since the irq
is optional here.
Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
---
drivers/remoteproc/stm32_rproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 98234b44f038..1f53c672c66b 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -712,9 +712,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
unsigned int tzen;
int err, irq;
- irq = platform_get_irq(pdev, 0);
+ irq = platform_get_irq_optional(pdev, 0);
if (irq == -EPROBE_DEFER)
- return dev_err_probe(dev, irq, "failed to get interrupt\n");
+ return irq;
if (irq > 0) {
err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Linux-stm32] [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe()
2023-08-17 8:33 [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe() Chen Jiahao
@ 2023-08-30 12:36 ` Arnaud POULIQUEN
2023-09-13 16:24 ` Mathieu Poirier
1 sibling, 0 replies; 3+ messages in thread
From: Arnaud POULIQUEN @ 2023-08-30 12:36 UTC (permalink / raw)
To: Chen Jiahao, andersson, mathieu.poirier, mcoquelin.stm32,
alexandre.torgue, linux-remoteproc, linux-stm32, linux-arm-kernel
Hi chen
On 8/17/23 10:33, 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 outside dev_err_probe() to
> clean it up.
>
> Besides, switch to use platform_get_irq_optional() since the irq
> is optional here.
>
> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
Sorry for the late answer, my company's mail server drop the email :(
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Thanks!
Arnaud
> ---
> drivers/remoteproc/stm32_rproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index 98234b44f038..1f53c672c66b 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -712,9 +712,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
> unsigned int tzen;
> int err, irq;
>
> - irq = platform_get_irq(pdev, 0);
> + irq = platform_get_irq_optional(pdev, 0);
> if (irq == -EPROBE_DEFER)
> - return dev_err_probe(dev, irq, "failed to get interrupt\n");
> + return irq;
>
> if (irq > 0) {
> err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe()
2023-08-17 8:33 [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe() Chen Jiahao
2023-08-30 12:36 ` [Linux-stm32] " Arnaud POULIQUEN
@ 2023-09-13 16:24 ` Mathieu Poirier
1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Poirier @ 2023-09-13 16:24 UTC (permalink / raw)
To: Chen Jiahao
Cc: andersson, mcoquelin.stm32, alexandre.torgue, linux-remoteproc,
linux-stm32, linux-arm-kernel, arnaud.pouliquen
On Thu, Aug 17, 2023 at 04:33:36PM +0800, 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 outside dev_err_probe() to
> clean it up.
>
> Besides, switch to use platform_get_irq_optional() since the irq
> is optional here.
>
> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
> ---
> drivers/remoteproc/stm32_rproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Applied.
Thanks,
Mathieu
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index 98234b44f038..1f53c672c66b 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -712,9 +712,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev,
> unsigned int tzen;
> int err, irq;
>
> - irq = platform_get_irq(pdev, 0);
> + irq = platform_get_irq_optional(pdev, 0);
> if (irq == -EPROBE_DEFER)
> - return dev_err_probe(dev, irq, "failed to get interrupt\n");
> + return irq;
>
> if (irq > 0) {
> err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
> --
> 2.34.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-13 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 8:33 [PATCH -next v2] remoteproc: stm32: Clean up redundant dev_err_probe() Chen Jiahao
2023-08-30 12:36 ` [Linux-stm32] " Arnaud POULIQUEN
2023-09-13 16:24 ` Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox