提交 92ed2eb7 编写于 作者: A Andrew Lunn 提交者: David S. Miller

net: phy: probe the PHY before determining the supported features

We will soon support asking the PHY at runtime to determine what
features it supports, rather than forcing it to be compile time.
But we should probe the PHY first. So probe the phy driver earlier.
Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 50684da7
......@@ -2220,6 +2220,18 @@ static int phy_probe(struct device *dev)
mutex_lock(&phydev->lock);
if (phydev->drv->probe) {
/* Deassert the reset signal */
phy_device_reset(phydev, 0);
err = phydev->drv->probe(phydev);
if (err) {
/* Assert the reset signal */
phy_device_reset(phydev, 1);
goto out;
}
}
/* Start out supporting everything. Eventually,
* a controller will attach, and may modify one
* or both of these values
......@@ -2267,17 +2279,7 @@ static int phy_probe(struct device *dev)
/* Set the state to READY by default */
phydev->state = PHY_READY;
if (phydev->drv->probe) {
/* Deassert the reset signal */
phy_device_reset(phydev, 0);
err = phydev->drv->probe(phydev);
if (err) {
/* Assert the reset signal */
phy_device_reset(phydev, 1);
}
}
out:
mutex_unlock(&phydev->lock);
return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册