Commit 9abf0c2b authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: bcmgenet: 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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae21888f
...@@ -298,6 +298,7 @@ int bcmgenet_mii_config(struct net_device *dev) ...@@ -298,6 +298,7 @@ int bcmgenet_mii_config(struct net_device *dev)
static int bcmgenet_mii_probe(struct net_device *dev) static int bcmgenet_mii_probe(struct net_device *dev)
{ {
struct bcmgenet_priv *priv = netdev_priv(dev); struct bcmgenet_priv *priv = netdev_priv(dev);
struct device_node *dn = priv->pdev->dev.of_node;
struct phy_device *phydev; struct phy_device *phydev;
unsigned int phy_flags; unsigned int phy_flags;
int ret; int ret;
...@@ -307,15 +308,19 @@ static int bcmgenet_mii_probe(struct net_device *dev) ...@@ -307,15 +308,19 @@ static int bcmgenet_mii_probe(struct net_device *dev)
return 0; return 0;
} }
if (priv->phy_dn) /* In the case of a fixed PHY, the DT node associated
phydev = of_phy_connect(dev, priv->phy_dn, * to the PHY is the Ethernet MAC DT node.
bcmgenet_mii_setup, 0, */
priv->phy_interface); if (of_phy_is_fixed_link(dn)) {
else ret = of_phy_register_fixed_link(dn);
phydev = of_phy_connect_fixed_link(dev, if (ret)
bcmgenet_mii_setup, return ret;
priv->phy_interface);
priv->phy_dn = dn;
}
phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup, 0,
priv->phy_interface);
if (!phydev) { if (!phydev) {
pr_err("could not attach to PHY\n"); pr_err("could not attach to PHY\n");
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment