Skip to content

Commit

Permalink
bcm63xx_enet: Use platform_get_irq() to get the interrupt
Browse files Browse the repository at this point in the history
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on
static allocation of IRQ resources in DT core code, this
causes an issue when using hierarchical interrupt domains
using "interrupts" property in the node as this bypassed
the hierarchical setup and messed up the irq chaining.

In preparation for removal of static setup of IRQ resource
from DT core code use platform_get_irq().

Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Link: https://lore.kernel.org/r/20220303100815.25605-1-tangmeng@uniontech.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Meng Tang authored and Jakub Kicinski committed Mar 5, 2022
1 parent 61fd7ac commit 43ff0d7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,17 +1716,17 @@ static int bcm_enet_probe(struct platform_device *pdev)
struct bcm_enet_priv *priv;
struct net_device *dev;
struct bcm63xx_enet_platform_data *pd;
struct resource *res_irq, *res_irq_rx, *res_irq_tx;
int irq, irq_rx, irq_tx;
struct mii_bus *bus;
int i, ret;

if (!bcm_enet_shared_base[0])
return -EPROBE_DEFER;

res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
if (!res_irq || !res_irq_rx || !res_irq_tx)
irq = platform_get_irq(pdev, 0);
irq_rx = platform_get_irq(pdev, 1);
irq_tx = platform_get_irq(pdev, 2);
if (irq < 0 || irq_rx < 0 || irq_tx < 0)
return -ENODEV;

dev = alloc_etherdev(sizeof(*priv));
Expand All @@ -1748,9 +1748,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
goto out;
}

dev->irq = priv->irq = res_irq->start;
priv->irq_rx = res_irq_rx->start;
priv->irq_tx = res_irq_tx->start;
dev->irq = priv->irq = irq;
priv->irq_rx = irq_rx;
priv->irq_tx = irq_tx;

priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
if (IS_ERR(priv->mac_clk)) {
Expand Down

0 comments on commit 43ff0d7

Please sign in to comment.