Commit ab82cf7a authored by Chaithrika U S's avatar Chaithrika U S Committed by Kevin Hilman

ARM: DaVinci: EMAC: Fix phy_disconnect bug

Fix for phy_disconnect bug

Disconnect the phy device only if there is a PHY connected.
If the phy_mask is zero, the phydev pointer is null, therefore
check the phydevice before disconnection.
Signed-off-by: default avatarChaithrika U S <chaithrika@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 6f5e22d6
......@@ -2541,7 +2541,8 @@ static int emac_dev_stop(struct net_device *ndev)
emac_cleanup_rxch(priv, EMAC_DEF_RX_CH);
emac_write(EMAC_SOFTRESET, 1);
phy_disconnect(priv->phydev);
if (priv->phydev)
phy_disconnect(priv->phydev);
/* Free IRQ */
while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, i))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment