diff options
| author | bui duc phuc <phucduc.bui@gmail.com> | 2026-09-11 11:00:21 +0700 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-09-15 10:01:04 +0200 |
| commit | 20d1b74a32d0044bb797da599069b382cb58f1d2 (patch) | |
| tree | ec8ffd2ca1d3525274a650211087dab2b50c8998 | |
| parent | 2343cff0b382c9e9c965c75cebfe83d2150a96c7 (diff) | |
| download | linux-next-20d1b74a32d0044bb797da599069b382cb58f1d2.tar.gz linux-next-20d1b74a32d0044bb797da599069b382cb58f1d2.zip | |
net: fec: Handle optional IRQ lookup errors correctly
Handle errors from platform_get_irq_byname_optional() explicitly while
preserving the existing fallback to platform_get_irq() when the named IRQ
is not available.
Propagate errors other than -ENXIO from the optional IRQ lookup instead
of silently falling back to the indexed IRQ lookup.
In particular, silently ignoring -EPROBE_DEFER can cause the driver to
continue probing instead of deferring as required.
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260911040021.12289-2-phucduc.bui@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
| -rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c6e29b5c2abb..f7636f23d1eb 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -5397,12 +5397,17 @@ fec_probe(struct platform_device *pdev) for (i = 0; i < irq_cnt; i++) { snprintf(irq_name, sizeof(irq_name), "int%d", i); irq = platform_get_irq_byname_optional(pdev, irq_name); - if (irq < 0) - irq = platform_get_irq(pdev, i); - if (irq < 0) { + if (irq < 0 && irq != -ENXIO) { ret = irq; goto failed_irq; } + if (irq == -ENXIO) { + irq = platform_get_irq(pdev, i); + if (irq < 0) { + ret = irq; + goto failed_irq; + } + } ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt, 0, pdev->name, ndev); if (ret) |
