[U-Boot] [PATCH 4/9] phy: atheros: ar8035: use phy_{read|write}_mmd()
Michael Walle
michael at walle.cc
Sat Oct 26 00:26:25 UTC 2019
Signed-off-by: Michael Walle <michael at walle.cc>
---
drivers/net/phy/atheros.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index 629c6b192a..113374f03f 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -110,13 +110,12 @@ static int ar8031_config(struct phy_device *phydev)
static int ar8035_config(struct phy_device *phydev)
{
int ret;
- int regval;
- phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x0007);
- phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
- phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
- regval = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
- phy_write(phydev, MDIO_DEVAD_NONE, 0xe, (regval|0x0018));
+ ret = phy_read_mmd(phydev, 7, 0x8016);
+ if (ret < 0)
+ return ret;
+ ret |= 0x0018;
+ phy_write_mmd(phydev, 7, 0x8016, ret);
ret = ar803x_delay_config(phydev);
if (ret < 0)
--
2.20.1
More information about the U-Boot
mailing list