Skip to content

Commit fc191af

Browse files
mklntfdavem330
authored andcommitted
net: stmmac: platform: Fix misleading interrupt error msg
Not every stmmac based platform makes use of the eth_wake_irq or eth_lpi interrupts. Use the platform_get_irq_byname_optional variant for these interrupts, so no error message is displayed, if they can't be found. Rather print an information to hint something might be wrong to assist debugging on platforms which use these interrupts. Signed-off-by: Markus Fuchs <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 13d0f7b commit fc191af

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,16 +663,22 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
663663
* In case the wake up interrupt is not passed from the platform
664664
* so the driver will continue to use the mac irq (ndev->irq)
665665
*/
666-
stmmac_res->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq");
666+
stmmac_res->wol_irq =
667+
platform_get_irq_byname_optional(pdev, "eth_wake_irq");
667668
if (stmmac_res->wol_irq < 0) {
668669
if (stmmac_res->wol_irq == -EPROBE_DEFER)
669670
return -EPROBE_DEFER;
671+
dev_info(&pdev->dev, "IRQ eth_wake_irq not found\n");
670672
stmmac_res->wol_irq = stmmac_res->irq;
671673
}
672674

673-
stmmac_res->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi");
674-
if (stmmac_res->lpi_irq == -EPROBE_DEFER)
675-
return -EPROBE_DEFER;
675+
stmmac_res->lpi_irq =
676+
platform_get_irq_byname_optional(pdev, "eth_lpi");
677+
if (stmmac_res->lpi_irq < 0) {
678+
if (stmmac_res->lpi_irq == -EPROBE_DEFER)
679+
return -EPROBE_DEFER;
680+
dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
681+
}
676682

677683
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
678684
stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res);

0 commit comments

Comments
 (0)