]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: phy: genphy_c45_baset1_an_config_aneg: do no set unknown configuration
authorOleksij Rempel <o.rempel@pengutronix.de>
Fri, 6 May 2022 04:23:51 +0000 (06:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 May 2022 11:09:29 +0000 (12:09 +0100)
Do not change default master/slave autoneg configuration if no
changes was requested.

Fixes: 101de7da0e4f ("net: phy: Add 10BASE-T1L support in phy-c45")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c

index eefdd67d55562ae028f151c115b57b3bed90fc8f..0014aa6e73c0e6c02ba8ef113198206e7e7eff7e 100644 (file)
@@ -191,8 +191,12 @@ static int genphy_c45_baset1_an_config_aneg(struct phy_device *phydev)
        case MASTER_SLAVE_CFG_MASTER_PREFERRED:
        case MASTER_SLAVE_CFG_SLAVE_PREFERRED:
                break;
+       case MASTER_SLAVE_CFG_UNKNOWN:
+       case MASTER_SLAVE_CFG_UNSUPPORTED:
+               return 0;
        default:
-               break;
+               phydev_warn(phydev, "Unsupported Master/Slave mode\n");
+               return -EOPNOTSUPP;
        }
 
        switch (phydev->master_slave_set) {