Re: [RFC PATCH net-next 1/2] net: phy: exported the genphy_read_master_slave function

Andrew Lunn
2022-03-07T13:53:30Z

> @@ -2401,9 +2396,14 @@ int genphy_read_status(struct phy_device *phydev)
> phydev->pause = 0;
> phydev->asym_pause = 0;
>
> - err = genphy_read_master_slave(phydev);
> - if (err < 0)
> - return err;
> + if (phydev->is_gigabit_capable) {
> + err = genphy_read_master_slave(phydev);
> + if (err < 0)
> + return err;
> + } else {
> + phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED;
> + phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED;
> + }

Rather than have this else clause, just initialize them to
_UNSUPPORTED, in the same block as speed, duplex and pause are
initialized above.

Otherwise, this looks good.

Andrew