From: Frank Wunderlich Date: Thu, 19 Jun 2025 13:21:24 +0000 (+0200) Subject: net: ethernet: mtk_eth_soc: only use legacy mode on missing IRQ name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=070e98dd4e26279280e15db8f37077a001ca1b4c;p=thirdparty%2Fkernel%2Flinux.git net: ethernet: mtk_eth_soc: only use legacy mode on missing IRQ name If platform_get_irq_byname returns -ENXIO fall back to legacy (index based) mode, but on other errors function should return this error. Suggested-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250619132125.78368-5-linux@fw-web.de Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 67ba8927be468..f8a907747db41 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3346,6 +3346,13 @@ static int mtk_get_irqs(struct platform_device *pdev, struct mtk_eth *eth) if (eth->irq[MTK_FE_IRQ_TX] >= 0 && eth->irq[MTK_FE_IRQ_RX] >= 0) return 0; + /* only use legacy mode if platform_get_irq_byname returned -ENXIO */ + if (eth->irq[MTK_FE_IRQ_TX] != -ENXIO) + return eth->irq[MTK_FE_IRQ_TX]; + + if (eth->irq[MTK_FE_IRQ_RX] != -ENXIO) + return eth->irq[MTK_FE_IRQ_RX]; + /* legacy way: * On MTK_SHARED_INT SoCs (MT7621 + MT7628) the first IRQ is taken * from devicetree and used for both RX and TX - it is shared.