提交 65818fa7 编写于 作者: G Giuseppe CAVALLARO 提交者: David S. Miller

stmmac: do not call fix_mac_speed if NULL

On some platforms, fix_mac_speed is used for
configuring some sysconf registers according
to the working speed.
This patch fixes the fix_mac_speed invocation
that cannot be done if it is a NULL pointer.
Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ca5f12c1
......@@ -258,8 +258,9 @@ static void stmmac_adjust_link(struct net_device *dev)
} else {
ctrl &= ~priv->mac_type->hw.link.port;
}
priv->fix_mac_speed(priv->bsp_priv,
phydev->speed);
if (likely(priv->fix_mac_speed))
priv->fix_mac_speed(priv->bsp_priv,
phydev->speed);
break;
default:
if (netif_msg_link(priv))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册