linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwrng: imx-rngc - platform_get_irq() already prints an error
@ 2020-10-18 22:29 Nigel Christian
  2020-10-22 20:16 ` Martin Kaiser
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel Christian @ 2020-10-18 22:29 UTC (permalink / raw)
  To: mpm, herbert, yuehaibing, hadar.gat, martin, arnd; +Cc: linux-crypto

There is no need to call the dev_err() function directly to print
a custom message when handling an error from platform_get_irq()
as it prints the appropriate message in the event of a failure.
Change suggested via coccicheck report.

Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
---
 drivers/char/hw_random/imx-rngc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 61c844baf26e..69f13ff1bbec 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -253,7 +253,6 @@ static int imx_rngc_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(&pdev->dev, "Couldn't get irq %d\n", irq);
 		return irq;
 	}
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwrng: imx-rngc - platform_get_irq() already prints an error
  2020-10-18 22:29 [PATCH] hwrng: imx-rngc - platform_get_irq() already prints an error Nigel Christian
@ 2020-10-22 20:16 ` Martin Kaiser
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Kaiser @ 2020-10-22 20:16 UTC (permalink / raw)
  To: Nigel Christian; +Cc: mpm, herbert, yuehaibing, hadar.gat, arnd, linux-crypto

Thus wrote Nigel Christian (nigel.l.christian@gmail.com):

> There is no need to call the dev_err() function directly to print
> a custom message when handling an error from platform_get_irq()
> as it prints the appropriate message in the event of a failure.
> Change suggested via coccicheck report.

> Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
> ---
>  drivers/char/hw_random/imx-rngc.c | 1 -
>  1 file changed, 1 deletion(-)

> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
> index 61c844baf26e..69f13ff1bbec 100644
> --- a/drivers/char/hw_random/imx-rngc.c
> +++ b/drivers/char/hw_random/imx-rngc.c
> @@ -253,7 +253,6 @@ static int imx_rngc_probe(struct platform_device *pdev)

>  	irq = platform_get_irq(pdev, 0);
>  	if (irq <= 0) {
> -		dev_err(&pdev->dev, "Couldn't get irq %d\n", irq);
>  		return irq;
>  	}

Looks good to me. This suppresses the error message if platform_get_irq
returns -EPROBE_DEFER, which makes more sense than the current code.

Reviewed-by: Martin Kaiser <martin@kaiser.cx>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-22 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-18 22:29 [PATCH] hwrng: imx-rngc - platform_get_irq() already prints an error Nigel Christian
2020-10-22 20:16 ` Martin Kaiser

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).