Messages in this thread Patch in this message | | | From | Arun Ramadoss <> | Subject | [RFC Patch net-next 1/3] net: phy: lan87xx: added lan87xx_update_link routine | Date | Mon, 21 Mar 2022 21:23:35 +0530 |
| |
The LAN87xx phydev->link has been updated via lan87xx_read_status routine. To get only the recent phydev->link status instead of various other status, refactored the code to have separate lan87xx_update_link routine.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com> --- drivers/net/phy/microchip_t1.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c index 389df3f4293c..bb4514254adc 100644 --- a/drivers/net/phy/microchip_t1.c +++ b/drivers/net/phy/microchip_t1.c @@ -674,7 +674,7 @@ static int lan87xx_cable_test_get_status(struct phy_device *phydev, return 0; } -static int lan87xx_read_status(struct phy_device *phydev) +static int lan87xx_update_link(struct phy_device *phydev) { int rc = 0; @@ -687,6 +687,17 @@ static int lan87xx_read_status(struct phy_device *phydev) else phydev->link = 0; + return rc; +} + +static int lan87xx_read_status(struct phy_device *phydev) +{ + int rc = 0; + + rc = lan87xx_update_link(phydev); + if (rc < 0) + return rc; + phydev->speed = SPEED_UNKNOWN; phydev->duplex = DUPLEX_UNKNOWN; phydev->pause = 0; -- 2.33.0
| |