Skip to content

Commit

Permalink
stmmac: do not call fix_mac_speed if NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Giuseppe CAVALLARO authored and David S. Miller committed Jan 8, 2010
1 parent ca5f12c commit 65818fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 65818fa

Please sign in to comment.