提交 a5996989 编写于 作者: H Heiner Kallweit 提交者: David S. Miller

net: phy: improve phy_init_hw

Currently the soft reset (if defined) is done only if the driver also
implements the config_init callback. I think this dependency is a
mistake, so let's remove it.
Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 21e19442
......@@ -1072,7 +1072,7 @@ int phy_init_hw(struct phy_device *phydev)
/* Deassert the reset signal */
phy_device_reset(phydev, 0);
if (!phydev->drv || !phydev->drv->config_init)
if (!phydev->drv)
return 0;
if (phydev->drv->soft_reset)
......@@ -1085,7 +1085,10 @@ int phy_init_hw(struct phy_device *phydev)
if (ret < 0)
return ret;
return phydev->drv->config_init(phydev);
if (phydev->drv->config_init)
ret = phydev->drv->config_init(phydev);
return ret;
}
EXPORT_SYMBOL(phy_init_hw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册