Commit ae3696c1 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by David S. Miller

net: macb: fix phy interrupt parsing

Since 83a77e9e, the phydev irq is explicitly set to PHY_POLL when
there is no pdata. It doesn't work on DT enabled platforms because the
phydev irq is already set by libphy before.

Fixes: 83a77e9e ("net: macb: Added PCI wrapper for Platform Driver.")
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dd5b698
...@@ -432,9 +432,10 @@ static int macb_mii_probe(struct net_device *dev) ...@@ -432,9 +432,10 @@ static int macb_mii_probe(struct net_device *dev)
} }
pdata = dev_get_platdata(&bp->pdev->dev); pdata = dev_get_platdata(&bp->pdev->dev);
if (pdata && gpio_is_valid(pdata->phy_irq_pin)) { if (pdata) {
ret = devm_gpio_request(&bp->pdev->dev, pdata->phy_irq_pin, if (gpio_is_valid(pdata->phy_irq_pin)) {
"phy int"); ret = devm_gpio_request(&bp->pdev->dev,
pdata->phy_irq_pin, "phy int");
if (!ret) { if (!ret) {
phy_irq = gpio_to_irq(pdata->phy_irq_pin); phy_irq = gpio_to_irq(pdata->phy_irq_pin);
phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq; phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
...@@ -442,6 +443,7 @@ static int macb_mii_probe(struct net_device *dev) ...@@ -442,6 +443,7 @@ static int macb_mii_probe(struct net_device *dev)
} else { } else {
phydev->irq = PHY_POLL; phydev->irq = PHY_POLL;
} }
}
/* attach the mac to the phy */ /* attach the mac to the phy */
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, ret = phy_connect_direct(dev, phydev, &macb_handle_link_change,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment