Skip to content

Commit

Permalink
fs_enet: use the new fixed PHY helpers
Browse files Browse the repository at this point in the history
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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed May 22, 2014
1 parent 186534a commit bb74d9a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ static int fs_init_phy(struct net_device *dev)

phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
iface);
if (!phydev) {
phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
iface);
}
if (!phydev) {
dev_err(&dev->dev, "Could not attach to PHY\n");
return -ENODEV;
Expand Down Expand Up @@ -1029,9 +1025,16 @@ static int fs_enet_probe(struct platform_device *ofdev)
fpi->use_napi = 1;
fpi->napi_weight = 17;
fpi->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0);
if ((!fpi->phy_node) && (!of_get_property(ofdev->dev.of_node, "fixed-link",
NULL)))
goto out_free_fpi;
if (!fpi->phy_node && of_phy_is_fixed_link(ofdev->dev.of_node)) {
err = of_phy_register_fixed_link(ofdev->dev.of_node);
if (err)
goto out_free_fpi;

/* In the case of a fixed PHY, the DT node associated
* to the PHY is the Ethernet MAC DT node.
*/
fpi->phy_node = ofdev->dev.of_node;
}

if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) {
phy_connection_type = of_get_property(ofdev->dev.of_node,
Expand Down

0 comments on commit bb74d9a

Please sign in to comment.