Commit 8ecd80a5 authored by Fabrice Gasnier's avatar Fabrice Gasnier Committed by David S. Miller

stmmac: fix phy init when attached to a phy

phy_bus_name can be NULL when "fixed-link" property isn't used.
Then, since "stmmac: do not poll phy handler when attach a switch",
phy_bus_name ptr needs to be checked before strcmp is called.
Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8e99fc5f
...@@ -868,6 +868,7 @@ static int stmmac_init_phy(struct net_device *dev) ...@@ -868,6 +868,7 @@ static int stmmac_init_phy(struct net_device *dev)
} }
/* If attached to a switch, there is no reason to poll phy handler */ /* If attached to a switch, there is no reason to poll phy handler */
if (priv->plat->phy_bus_name)
if (!strcmp(priv->plat->phy_bus_name, "fixed")) if (!strcmp(priv->plat->phy_bus_name, "fixed"))
phydev->irq = PHY_IGNORE_INTERRUPT; phydev->irq = PHY_IGNORE_INTERRUPT;
......
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