]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: ethoc: Switch to new U-Boot PHY API
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Tue, 30 May 2023 22:51:21 +0000 (00:51 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 10 Jun 2023 11:34:05 +0000 (13:34 +0200)
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>
drivers/net/ethoc.c

index 29067e9e94948f7b0b9c20fc35e6af60d8b2beed..13fad8119bb5d133867360b6143d472cafbfe228 100644 (file)
@@ -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;