Skip to content

Commit

Permalink
net: phy: lan87xx: use genphy_read_master_slave in read_status
Browse files Browse the repository at this point in the history
To read the master slave configuration of the LAN87xx T1 phy, used the
generic phy driver genphy_read_master_slave function. Removed the local
lan87xx_read_master_slave function.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Arun Ramadoss authored and Paolo Abeni committed Mar 8, 2022
1 parent 64807c2 commit f1f3a67
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions drivers/net/phy/microchip_t1.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,34 +674,6 @@ static int lan87xx_cable_test_get_status(struct phy_device *phydev,
return 0;
}

static int lan87xx_read_master_slave(struct phy_device *phydev)
{
int rc = 0;

phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN;
phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN;

rc = phy_read(phydev, MII_CTRL1000);
if (rc < 0)
return rc;

if (rc & CTL1000_AS_MASTER)
phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE;
else
phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE;

rc = phy_read(phydev, MII_STAT1000);
if (rc < 0)
return rc;

if (rc & LPA_1000MSRES)
phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER;
else
phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE;

return rc;
}

static int lan87xx_read_status(struct phy_device *phydev)
{
int rc = 0;
Expand All @@ -720,7 +692,7 @@ static int lan87xx_read_status(struct phy_device *phydev)
phydev->pause = 0;
phydev->asym_pause = 0;

rc = lan87xx_read_master_slave(phydev);
rc = genphy_read_master_slave(phydev);
if (rc < 0)
return rc;

Expand Down

0 comments on commit f1f3a67

Please sign in to comment.