diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-04-19 09:55:58 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-04-19 09:56:17 +0400 |
commit | 68d2cf25d39324c54b5e42de7915c623a0917abe (patch) | |
tree | ff1291450d7e6630bc77ec1363c3db8d74fa58b0 /drivers/net/phy/phy_device.c | |
parent | 176fcc5c5f0131504a55e1e1d35389c49a9177c2 (diff) | |
parent | 5d2cd90922c778908bd0cd669e572a5b5eafd737 (diff) | |
download | linux-68d2cf25d39324c54b5e42de7915c623a0917abe.tar.xz |
Merge branch 'perf/urgent' into perf/core
Merge reason: we'll be queueing up dependent changes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 993c52c82aeb..ff109fe5af6b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -442,11 +442,11 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, u32 flags, phy_interface_t interface) { struct device *d = &phydev->dev; + int err; /* Assume that if there is no driver, that it doesn't * exist, and we should use the genphy driver. */ if (NULL == d->driver) { - int err; d->driver = &genphy_driver.driver; err = d->driver->probe(d); @@ -474,7 +474,11 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, /* Do initial configuration here, now that * we have certain key parameters * (dev_flags and interface) */ - return phy_init_hw(phydev); + err = phy_init_hw(phydev); + if (err) + phy_detach(phydev); + + return err; } /** @@ -534,7 +538,7 @@ EXPORT_SYMBOL(phy_detach); /* Generic PHY support and helper functions */ /** - * genphy_config_advert - sanitize and advertise auto-negotation parameters + * genphy_config_advert - sanitize and advertise auto-negotiation parameters * @phydev: target phy_device struct * * Description: Writes MII_ADVERTISE with the appropriate values, @@ -683,7 +687,7 @@ int genphy_config_aneg(struct phy_device *phydev) return result; if (result == 0) { - /* Advertisment hasn't changed, but maybe aneg was never on to + /* Advertisement hasn't changed, but maybe aneg was never on to * begin with? Or maybe phy was isolated? */ int ctl = phy_read(phydev, MII_BMCR); |