Now that we detect whether a PHY supports stopping its clock during LPI,
deny a call to phy_init_eee() with clk_stop_enable being set and the PHY
not supporting that.

Signed-off-by: Florian Fainelli <f.faine...@gmail.com>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ba4676ee9018..1c3800e01d82 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1251,7 +1251,7 @@ int phy_init_eee(struct phy_device *phydev, bool 
clk_stop_enable)
                if (!phy_check_valid(phydev->speed, phydev->duplex, lp & adv))
                        goto eee_exit_err;
 
-               if (clk_stop_enable) {
+               if (clk_stop_enable && phydev->clk_stop_cap) {
                        /* Configure the PHY to stop receiving xMII
                         * clock while it is signaling LPI.
                         */
-- 
2.9.3

Reply via email to