| From 55ec4dfc7b21cf8f7f2455893232cd794389be14 Mon Sep 17 00:00:00 2001 |
| From: Markus Fuchs <mklntf@gmail.com> |
| Date: Fri, 6 Mar 2020 17:38:48 +0100 |
| Subject: [PATCH] net: stmmac: platform: Fix misleading interrupt error msg |
| |
| commit fc191af1bb0d069dc7e981076e8b80af21f1e61d upstream. |
| |
| 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 <mklntf@gmail.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
| index fb8f6e2fe989..a4473143f582 100644 |
| --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
| +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
| @@ -636,16 +636,22 @@ int stmmac_get_platform_resources(struct platform_device *pdev, |
| * In case the wake up interrupt is not passed from the platform |
| * so the driver will continue to use the mac irq (ndev->irq) |
| */ |
| - stmmac_res->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq"); |
| + stmmac_res->wol_irq = |
| + platform_get_irq_byname_optional(pdev, "eth_wake_irq"); |
| if (stmmac_res->wol_irq < 0) { |
| if (stmmac_res->wol_irq == -EPROBE_DEFER) |
| return -EPROBE_DEFER; |
| + dev_info(&pdev->dev, "IRQ eth_wake_irq not found\n"); |
| stmmac_res->wol_irq = stmmac_res->irq; |
| } |
| |
| - stmmac_res->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi"); |
| - if (stmmac_res->lpi_irq == -EPROBE_DEFER) |
| - return -EPROBE_DEFER; |
| + stmmac_res->lpi_irq = |
| + platform_get_irq_byname_optional(pdev, "eth_lpi"); |
| + if (stmmac_res->lpi_irq < 0) { |
| + if (stmmac_res->lpi_irq == -EPROBE_DEFER) |
| + return -EPROBE_DEFER; |
| + dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); |
| + } |
| |
| res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res); |
| -- |
| 2.7.4 |
| |