EDAC/xgene: Fix deferred probing
authorSergey Shtylyov <s.shtylyov@omp.ru>
Mon, 24 Jan 2022 18:55:03 +0000 (21:55 +0300)
committerBorislav Petkov <bp@suse.de>
Sun, 30 Jan 2022 00:06:35 +0000 (01:06 +0100)
The driver overrides error codes returned by platform_get_irq_optional()
to -EINVAL for some strange reason, so if it returns -EPROBE_DEFER, the
driver will fail the probe permanently instead of the deferred probing.
Switch to propagating the proper error codes to platform driver code
upwards.

  [ bp: Massage commit message. ]

Fixes: 0d4429301c4a ("EDAC: Add APM X-Gene SoC EDAC driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220124185503.6720-3-s.shtylyov@omp.ru
drivers/edac/xgene_edac.c

index 2ccd1db5e98ff0bcc9cae1db0b3a74f3fa434841..7197f9fa024572f72aec324af64cd382820ffac1 100644 (file)
@@ -1919,7 +1919,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
                        irq = platform_get_irq_optional(pdev, i);
                        if (irq < 0) {
                                dev_err(&pdev->dev, "No IRQ resource\n");
-                               rc = -EINVAL;
+                               rc = irq;
                                goto out_err;
                        }
                        rc = devm_request_irq(&pdev->dev, irq,