lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH net-next 1/2] net: phy: exported the genphy_read_master_slave function
> @@ -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

\
 
 \ /
  Last update: 2022-03-07 14:55    [W:0.056 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site