Skip to content

Commit 8700981

Browse files
ffainellidavem330
authored andcommitted
ucc_geth: use the new fixed PHY helpers
of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent be40364 commit 8700981

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/net/ethernet/freescale/ucc_geth.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,9 +1728,6 @@ static int init_phy(struct net_device *dev)
17281728

17291729
phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
17301730
priv->phy_interface);
1731-
if (!phydev)
1732-
phydev = of_phy_connect_fixed_link(dev, &adjust_link,
1733-
priv->phy_interface);
17341731
if (!phydev) {
17351732
dev_err(&dev->dev, "Could not attach to PHY\n");
17361733
return -ENODEV;
@@ -3790,6 +3787,17 @@ static int ucc_geth_probe(struct platform_device* ofdev)
37903787
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
37913788

37923789
ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
3790+
if (!ug_info->phy_node) {
3791+
/* In the case of a fixed PHY, the DT node associated
3792+
* to the PHY is the Ethernet MAC DT node.
3793+
*/
3794+
if (of_phy_is_fixed_link(np)) {
3795+
err = of_phy_register_fixed_link(np);
3796+
if (err)
3797+
return err;
3798+
}
3799+
ug_info->phy_node = np;
3800+
}
37933801

37943802
/* Find the TBI PHY node. If it's not there, we don't support SGMII */
37953803
ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);

0 commit comments

Comments
 (0)