net: phy: genphy_c45_pma_baset1_setup_master_slave: do no set unknown configuration
authorOleksij Rempel <o.rempel@pengutronix.de>
Fri, 6 May 2022 04:23:53 +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 forced configuration if no changes was
requested.

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 ffa2d5cd09fc646be6c70726656f3a0f36fd4c15..b1f7c63f66cd1502094577392245b95c211477f9 100644 (file)
@@ -86,9 +86,10 @@ int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev)
                break;
        case MASTER_SLAVE_CFG_SLAVE_FORCE:
        case MASTER_SLAVE_CFG_SLAVE_PREFERRED:
+               break;
        case MASTER_SLAVE_CFG_UNKNOWN:
        case MASTER_SLAVE_CFG_UNSUPPORTED:
-               break;
+               return 0;
        default:
                phydev_warn(phydev, "Unsupported Master/Slave mode\n");
                return -EOPNOTSUPP;