aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-01-21 14:41:32 -0800
committerDavid S. Miller <davem@davemloft.net>2019-01-21 14:41:32 -0800
commitfa7f3a8d56b38a3ed1880a3780afba82387da277 (patch)
treea4628ee966f21963e5e97a6d1a227a3e8138183e /drivers/net/phy/phy.c
parentMerge branch 'mlxsw-spectrum_router-Add-GRE-tunnel-support-for-Spectrum-2' (diff)
parentLinux 5.0-rc3 (diff)
downloadlinux-dev-fa7f3a8d56b38a3ed1880a3780afba82387da277.tar.xz
linux-dev-fa7f3a8d56b38a3ed1880a3780afba82387da277.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Completely minor snmp doc conflict. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f7a92e7edff7..745a705a505a 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -538,13 +538,6 @@ int phy_start_aneg(struct phy_device *phydev)
mutex_lock(&phydev->lock);
- if (!__phy_is_started(phydev)) {
- WARN(1, "called from state %s\n",
- phy_state_to_str(phydev->state));
- err = -EBUSY;
- goto out_unlock;
- }
-
if (AUTONEG_DISABLE == phydev->autoneg)
phy_sanitize_settings(phydev);
@@ -555,11 +548,13 @@ int phy_start_aneg(struct phy_device *phydev)
if (err < 0)
goto out_unlock;
- if (phydev->autoneg == AUTONEG_ENABLE) {
- err = phy_check_link_status(phydev);
- } else {
- phydev->state = PHY_FORCING;
- phydev->link_timeout = PHY_FORCE_TIMEOUT;
+ if (__phy_is_started(phydev)) {
+ if (phydev->autoneg == AUTONEG_ENABLE) {
+ err = phy_check_link_status(phydev);
+ } else {
+ phydev->state = PHY_FORCING;
+ phydev->link_timeout = PHY_FORCE_TIMEOUT;
+ }
}
out_unlock: