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
2220 2220
2221 mutex_lock(&phydev->lock);2221 mutex_lock(&phydev->lock);
2222 2222
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
2223 /* Start out supporting everything. Eventually,2235 /* Start out supporting everything. Eventually,
2224 * a controller will attach, and may modify one2236 * a controller will attach, and may modify one
2225 * or both of these values2237 * or both of these values
@@ -2267,17 +2279,7 @@ static int phy_probe(struct device *dev) · 41 unmodified lines
2267 /* Set the state to READY by default */2279 /* Set the state to READY by default */
2268 phydev->state = PHY_READY;2280 phydev->state = PHY_READY;
2269 2281
2270 if (phydev->drv->probe) {2282out:
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
2281 mutex_unlock(&phydev->lock);2283 mutex_unlock(&phydev->lock);
2282 2284
2283 return err;2285 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