[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200225122208.6881-1-sudheesh.mavila@amd.com>
Date:   Tue, 25 Feb 2020 17:52:08 +0530
From:   Sudheesh Mavila <sudheesh.mavila@....com>
To:     sudheesh.mavila@....com, andrew@...n.ch, f.fainelli@...il.com,
        hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] net: phy: corrected the return value for genphy_check_and_restart_aneg
When auto-negotiation is not required, return value should be zero.
Signed-off-by: Sudheesh Mavila <sudheesh.mavila@....com>
---
 drivers/net/phy/phy_device.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 6a5056e0ae77..36cde3dac4c3 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1806,10 +1806,13 @@ int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
 			restart = true;
 	}
 
-	if (restart)
-		ret = genphy_restart_aneg(phydev);
+	/* Only restart aneg if we are advertising something different
+	 * than we were before.
+	 */
+	if (restart > 0)
+		return genphy_restart_aneg(phydev);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL(genphy_check_and_restart_aneg);
 
-- 
2.17.1
Powered by blists - more mailing lists
 
