Skip to contentSkip to conversation

net: stmmac: set phy to use polling by default

PATCH Applied [email protected] 2 participants 2 messages Apr 29, 2014 – Apr 30, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: set phy to use polling by default

From: Dinh Nguyen <[email protected]>

mii_irq[] array is never initialized anywhere in the driver, thus mii_irq[] will always equate to zero. So, for the case where the PHY does not have an irq, we should use PHY_POLL for that situation.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +5 -2
index a468eb1..a5b1e1b 100644
@@ -205,10 +205,13 @@ int stmmac_mdio_register(struct net_device *ndev)
 	if (new_bus == NULL)
 		return -ENOMEM;
 
-	if (mdio_bus_data->irqs)
+	if (mdio_bus_data->irqs) {
 		irqlist = mdio_bus_data->irqs;
-	else
+	} else {
+		for (addr = 0; addr < PHY_MAX_ADDR; addr++)
+			priv->mii_irq[addr] = PHY_POLL;
 		irqlist = priv->mii_irq;
+	}
 
 #ifdef CONFIG_OF
 	if (priv->device->of_node)
Signature · 1 line
1.7.9.5