mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
net: phy: used genphy_soft_reset for phy reset in LAN87xx
Replaced the current code of resetting of LAN87xx phy to genphy_soft_reset library function. Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
828553d2c3
commit
8eee3d3536
1 changed files with 2 additions and 12 deletions
|
@ -197,21 +197,11 @@ static int lan87xx_phy_init(struct phy_device *phydev)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
/* Soft Reset the SMI block */
|
||||
rc = access_ereg_modify_changed(phydev, PHYACC_ATTR_BANK_SMI,
|
||||
0x00, 0x8000, 0x8000);
|
||||
/* phy Soft reset */
|
||||
rc = genphy_soft_reset(phydev);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
/* Check to see if the self-clearing bit is cleared */
|
||||
usleep_range(1000, 2000);
|
||||
rc = access_ereg(phydev, PHYACC_ATTR_MODE_READ,
|
||||
PHYACC_ATTR_BANK_SMI, 0x00, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
if ((rc & 0x8000) != 0)
|
||||
return -ETIMEDOUT;
|
||||
|
||||
/* PHY Initialization */
|
||||
for (i = 0; i < ARRAY_SIZE(init); i++) {
|
||||
if (init[i].mode == PHYACC_ATTR_MODE_MODIFY) {
|
||||
|
|
Loading…
Reference in a new issue