]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - drivers/net/sun8i_emac.c
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-net
[thirdparty/u-boot.git] / drivers / net / sun8i_emac.c
index b23faa228e0d053142c6d2228af7a91b0ee15f2c..2220f84b6978a1866ab56e50b79c4f99737693a4 100644 (file)
@@ -383,8 +383,6 @@ static int sun8i_phy_init(struct emac_eth_dev *priv, void *dev)
        if (!phydev)
                return -ENODEV;
 
-       phy_connect_dev(phydev, dev);
-
        priv->phydev = phydev;
        phy_config(priv->phydev);
 
@@ -795,7 +793,6 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev)
        struct sun8i_eth_pdata *sun8i_pdata = dev_get_plat(dev);
        struct eth_pdata *pdata = &sun8i_pdata->eth_pdata;
        struct emac_eth_dev *priv = dev_get_priv(dev);
-       const char *phy_mode;
        const fdt32_t *reg;
        int node = dev_of_offset(dev);
        int offset = 0;
@@ -859,16 +856,10 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev)
        }
        priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
 
-       phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
-
-       if (phy_mode)
-               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
+       pdata->phy_interface = dev_read_phy_mode(dev);
        printf("phy interface%d\n", pdata->phy_interface);
-
-       if (pdata->phy_interface == -1) {
-               debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
                return -EINVAL;
-       }
 
        if (priv->variant == H3_EMAC) {
                ret = sun8i_handle_internal_phy(dev, priv);