History

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.

Andrew Lunn committed 7 years ago

Commit 92ed2eb1 parent 50684da1 file · +13 −11Browse files

Unified · Split

drivers/net/phy/phy_device.c+13−11
@@ -2220,6 +2220,18 @@ static int phy_probe(struct device *dev) · 2219 unmodified lines
22202220
22212221 mutex_lock(&phydev->lock);
22222222
2223+ if (phydev->drv->probe) {
2224+ /* Deassert the reset signal */
2225+ phy_device_reset(phydev, 0);
2226+
2227+ err = phydev->drv->probe(phydev);
2228+ if (err) {
2229+ /* Assert the reset signal */
2230+ phy_device_reset(phydev, 1);
2231+ goto out;
2232+ }
2233+ }
2234+
22232235 /* Start out supporting everything. Eventually,
22242236 * a controller will attach, and may modify one
22252237 * or both of these values
@@ -2267,17 +2279,7 @@ static int phy_probe(struct device *dev) · 41 unmodified lines
22672279 /* Set the state to READY by default */
22682280 phydev->state = PHY_READY;
22692281
2270− if (phydev->drv->probe) {
2271− /* Deassert the reset signal */
2272− phy_device_reset(phydev, 0);
2273−
2274− err = phydev->drv->probe(phydev);
2275− if (err) {
2276− /* Assert the reset signal */
2277− phy_device_reset(phydev, 1);
2278− }
2279− }
2280−
2282+out:
22812283 mutex_unlock(&phydev->lock);
22822284
22832285 return err;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t