提交 8ecd80a5 编写于 作者: F Fabrice Gasnier 提交者: 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: NFabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: NAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8e99fc5f
......@@ -868,8 +868,9 @@ static int stmmac_init_phy(struct net_device *dev)
}
/* If attached to a switch, there is no reason to poll phy handler */
if (!strcmp(priv->plat->phy_bus_name, "fixed"))
phydev->irq = PHY_IGNORE_INTERRUPT;
if (priv->plat->phy_bus_name)
if (!strcmp(priv->plat->phy_bus_name, "fixed"))
phydev->irq = PHY_IGNORE_INTERRUPT;
pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)"
" Link = %d\n", dev->name, phydev->phy_id, phydev->link);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册