Commit 03377e38 authored by Iyappan Subramanian's avatar Iyappan Subramanian Committed by David S. Miller

drivers: net: xgene: Fix backward compatibility

This patch fixes the backward compatibility on handling phy_connect(), by
iterating over the phy-handle, when new DT is used with older kernel.
Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c50fc262
...@@ -761,18 +761,18 @@ int xgene_enet_phy_connect(struct net_device *ndev) ...@@ -761,18 +761,18 @@ int xgene_enet_phy_connect(struct net_device *ndev)
if (dev->of_node) { if (dev->of_node) {
for (i = 0 ; i < 2; i++) { for (i = 0 ; i < 2; i++) {
np = of_parse_phandle(dev->of_node, "phy-handle", i); np = of_parse_phandle(dev->of_node, "phy-handle", i);
if (np)
break;
}
if (!np) { if (!np)
netdev_dbg(ndev, "No phy-handle found in DT\n"); continue;
return -ENODEV;
}
phy_dev = of_phy_connect(ndev, np, &xgene_enet_adjust_link, phy_dev = of_phy_connect(ndev, np,
&xgene_enet_adjust_link,
0, pdata->phy_mode); 0, pdata->phy_mode);
of_node_put(np); of_node_put(np);
if (phy_dev)
break;
}
if (!phy_dev) { if (!phy_dev) {
netdev_err(ndev, "Could not connect to PHY\n"); netdev_err(ndev, "Could not connect 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