hwrng: imx-rngc - platform_get_irq() already prints an error
PATCH 1/1 hwrng: imx-rngc - platform_get_irq() already prints an error
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.
--- drivers/char/hw_random/imx-rngc.c | 1 - 1 file changed, 1 deletion(-)
drivers/char/hw_random/imx-rngc.c +0 -1
@@ -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; }
Signature · 1 line
2.28.0
Thus wrote Nigel Christian ([email protected]):
Quoted 15 lines
There is no need to call the
dev_err()function directly to print a custom message when handling an error fromplatform_get_irq()as it prints the appropriate message in the event of a failure. Change suggested via coccicheck report.Signed-off-by Nigel Christian <[email protected]>--- drivers/char/hw_random/imx-rngc.c | 1 - 1 file changed, 1 deletion(-)drivers/char/hw_random/imx-rngc.c +0
-0
drivers/char/hw_random/imx-rngc.c static int imx_rngc_probe(struct platform_device *pdev) · line 257
Quoted 6 lines
drivers/char/hw_random/imx-rngc.c +0
-1@@ -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.