]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: phy: xilinx_gmii2rgmii: Fill node pointer for external phy
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Sat, 16 Mar 2019 12:21:25 +0000 (17:51 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Sat, 16 Mar 2019 13:02:37 +0000 (14:02 +0100)
This patch fills external phy node pointer so that it will
be used in its driver to read its phy properties from DT.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/phy/xilinx_gmii2rgmii.c

index 681ebe3a7fd2c47bfd4fdc9fdc459159598494bf..8c20da2682067e6bcf09a3a2ca2427c43aa68900 100644 (file)
@@ -85,6 +85,7 @@ static int xilinxgmiitorgmii_probe(struct phy_device *phydev)
        int ofnode = phydev->addr;
        u32 phy_of_handle;
        int ext_phyaddr = -1;
+       struct phy_device *ext_phydev;
 
        debug("%s\n", __func__);
 
@@ -104,15 +105,17 @@ static int xilinxgmiitorgmii_probe(struct phy_device *phydev)
                ext_phyaddr = fdtdec_get_int(gd->fdt_blob,
                                             phy_of_handle,
                                             "reg", -1);
-       phydev->priv = phy_find_by_mask(phydev->bus,
-                                       1 << ext_phyaddr,
-                                       PHY_INTERFACE_MODE_RGMII);
-
-       if (!phydev->priv) {
+       ext_phydev = phy_find_by_mask(phydev->bus,
+                                     1 << ext_phyaddr,
+                                     PHY_INTERFACE_MODE_RGMII);
+       if (!ext_phydev) {
                printf("%s, No external phy device found\n", __func__);
                return -EINVAL;
        }
 
+       ext_phydev->node = offset_to_ofnode(phy_of_handle);
+       phydev->priv = ext_phydev;
+
        debug("%s, gmii2rgmmi:0x%x, extphy:0x%x\n", __func__, phydev->addr,
              ext_phyaddr);