net: phy: xilinx_gmii2rgmii: Fill node pointer for external phy
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>
This commit is contained in:
committed by
Michal Simek
parent
bf09e558d1
commit
8563ced8a0
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user