aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-05-31 00:51:24 +0200
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2023-06-10 13:34:05 +0200
commit83434e249f060ab4e1f57d6ec63c03d72eea50cf (patch)
tree4d59b371d342b91c2aa9874eaca5aea04cd3d9e2
parentb9b04f8c5f66c39ffc24b68d2175c40faed56c9e (diff)
downloadu-boot-83434e249f060ab4e1f57d6ec63c03d72eea50cf.zip
u-boot-83434e249f060ab4e1f57d6ec63c03d72eea50cf.tar.gz
u-boot-83434e249f060ab4e1f57d6ec63c03d72eea50cf.tar.bz2
net: sunxi_emac: Switch to new U-Boot PHY API
Use new U-Boot phy_connect() API which also supports fixed PHYs. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
-rw-r--r--drivers/net/sunxi_emac.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/sunxi_emac.c b/drivers/net/sunxi_emac.c
index ad9e1ab..4c90d4b 100644
--- a/drivers/net/sunxi_emac.c
+++ b/drivers/net/sunxi_emac.c
@@ -248,10 +248,10 @@ static int emac_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
static int sunxi_emac_init_phy(struct emac_eth_dev *priv, void *dev)
{
- int ret, mask = 0xffffffff;
+ int ret, mask = -1;
#ifdef CONFIG_PHY_ADDR
- mask = 1 << CONFIG_PHY_ADDR;
+ mask = CONFIG_PHY_ADDR;
#endif
priv->bus = mdio_alloc();
@@ -269,11 +269,10 @@ static int sunxi_emac_init_phy(struct emac_eth_dev *priv, void *dev)
if (ret)
return ret;
- priv->phydev = phy_find_by_mask(priv->bus, mask);
+ priv->phydev = phy_connect(priv->bus, mask, dev, PHY_INTERFACE_MODE_MII);
if (!priv->phydev)
return -ENODEV;
- phy_connect_dev(priv->phydev, dev, PHY_INTERFACE_MODE_MII);
phy_config(priv->phydev);
return 0;