[PATCH 04/14] net: ethoc: Switch to new U-Boot PHY API
Marek Vasut
marek.vasut+renesas at mailbox.org
Wed May 31 00:51:21 CEST 2023
Use new U-Boot phy_connect() API which also supports fixed PHYs.
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Geert Uytterhoeven <geert+renesas at glider.be>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Michal Simek <michal.simek at amd.com>
Cc: Nishanth Menon <nm at ti.com>
Cc: Ramon Fried <rfried.dev at gmail.com>
---
drivers/net/ethoc.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 29067e9e949..13fad8119bb 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -608,18 +608,16 @@ static int ethoc_mdio_init(const char *name, struct ethoc *priv)
static int ethoc_phy_init(struct ethoc *priv, void *dev)
{
struct phy_device *phydev;
- int mask = 0xffffffff;
+ int mask = -1;
#ifdef CONFIG_PHY_ADDR
- mask = 1 << CONFIG_PHY_ADDR;
+ mask = CONFIG_PHY_ADDR;
#endif
- phydev = phy_find_by_mask(priv->bus, mask);
+ phydev = phy_connect(priv->bus, mask, dev, PHY_INTERFACE_MODE_MII);
if (!phydev)
return -ENODEV;
- phy_connect_dev(phydev, dev, PHY_INTERFACE_MODE_MII);
-
phydev->supported &= PHY_BASIC_FEATURES;
phydev->advertising = phydev->supported;
--
2.39.2
More information about the U-Boot
mailing list