EDAC/xgene: Do not print a failure message to get an IRQ twice
authorMenglong Dong <dong.menglong@zte.com.cn>
Tue, 12 Jan 2021 10:35:40 +0000 (02:35 -0800)
committerBorislav Petkov <bp@suse.de>
Tue, 19 Jan 2021 09:22:23 +0000 (10:22 +0100)
Coccinelle reports a redundant error print in xgene_edac_probe() because
platform_get_irq() will already print an error message when it is unable
to get an IRQ.

Use platform_get_irq_optional() instead which avoids the error message
and keep the driver-specific one.

 [ bp: Sanitize commit message. ]

Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Robert Richter <rric@kernel.org>
Link: https://lkml.kernel.org/r/20210112103540.7818-1-dong.menglong@zte.com.cn
drivers/edac/xgene_edac.c

index 1d2c27a00a4a8348eb5e0d0c203eafa4520c7030..2ccd1db5e98ff0bcc9cae1db0b3a74f3fa434841 100644 (file)
@@ -1916,7 +1916,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
                int i;
 
                for (i = 0; i < 3; i++) {
-                       irq = platform_get_irq(pdev, i);
+                       irq = platform_get_irq_optional(pdev, i);
                        if (irq < 0) {
                                dev_err(&pdev->dev, "No IRQ resource\n");
                                rc = -EINVAL;