mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
net: ethernet: mtk_eth_soc: improve support for named interrupts
Use platform_get_irq_byname_optional() to avoid outputting error messages when using legacy device trees which rely identifying interrupts only by index. Instead, output a warning notifying the user to update their device tree. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/aeccd00eccb7186d39d2c16292019b3b22ec53b8.1751461762.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6058099da5
commit
e81d36d488
|
|
@ -3341,17 +3341,22 @@ static int mtk_get_irqs(struct platform_device *pdev, struct mtk_eth *eth)
|
|||
int i;
|
||||
|
||||
/* future SoCs beginning with MT7988 should use named IRQs in dts */
|
||||
eth->irq[MTK_FE_IRQ_TX] = platform_get_irq_byname(pdev, "fe1");
|
||||
eth->irq[MTK_FE_IRQ_RX] = platform_get_irq_byname(pdev, "fe2");
|
||||
eth->irq[MTK_FE_IRQ_TX] = platform_get_irq_byname_optional(pdev, "fe1");
|
||||
eth->irq[MTK_FE_IRQ_RX] = platform_get_irq_byname_optional(pdev, "fe2");
|
||||
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 */
|
||||
/* only use legacy mode if platform_get_irq_byname_optional returned -ENXIO */
|
||||
if (eth->irq[MTK_FE_IRQ_TX] != -ENXIO)
|
||||
return eth->irq[MTK_FE_IRQ_TX];
|
||||
return dev_err_probe(&pdev->dev, eth->irq[MTK_FE_IRQ_TX],
|
||||
"Error requesting FE TX IRQ\n");
|
||||
|
||||
if (eth->irq[MTK_FE_IRQ_RX] != -ENXIO)
|
||||
return eth->irq[MTK_FE_IRQ_RX];
|
||||
return dev_err_probe(&pdev->dev, eth->irq[MTK_FE_IRQ_RX],
|
||||
"Error requesting FE RX IRQ\n");
|
||||
|
||||
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT))
|
||||
dev_warn(&pdev->dev, "legacy DT: missing interrupt-names.");
|
||||
|
||||
/* legacy way:
|
||||
* On MTK_SHARED_INT SoCs (MT7621 + MT7628) the first IRQ is taken
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user