aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2010-01-06 18:07:16 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-07 20:06:08 -0500
commit65818fa744e70a58d230083dda1f1cd8e5c5e2ee (patch)
tree931659e1a0b2abda76c0829f6ab826b524cebbd0 /drivers/net
parentca5f12c1a82cf72ce73617dfc8ef56faf6fec30a (diff)
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 <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/stmmac/stmmac_main.c5
1 files changed, 3 insertions, 2 deletions
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)
258 } else { 258 } else {
259 ctrl &= ~priv->mac_type->hw.link.port; 259 ctrl &= ~priv->mac_type->hw.link.port;
260 } 260 }
261 priv->fix_mac_speed(priv->bsp_priv, 261 if (likely(priv->fix_mac_speed))
262 phydev->speed); 262 priv->fix_mac_speed(priv->bsp_priv,
263 phydev->speed);
263 break; 264 break;
264 default: 265 default:
265 if (netif_msg_link(priv)) 266 if (netif_msg_link(priv))