From: Giuseppe CAVALLARO Date: Wed, 6 Jan 2010 23:07:16 +0000 (+0000) Subject: stmmac: do not call fix_mac_speed if NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65818fa744e70a58d230083dda1f1cd8e5c5e2ee;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Giuseppe Cavallaro Signed-off-by: David S. Miller --- diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index a02006d57a59..82ebbc0c8839 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c @@ -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))