Skip to content

net: eth: altera: fix phy-handle not find issue #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: socfpga-6.12.11-lts
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions drivers/net/ethernet/altera/altera_tse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,18 +936,19 @@ static int init_phy(struct net_device *dev)

ret = phylink_of_phy_connect(priv->phylink, priv->device->of_node, 0);

if (ret) {
netdev_dbg(dev, "no phy-handle found\n");
if (!priv->mdio) {
netdev_err(dev, "No phy-handle nor local mdio specified\n");
if (!ret)
return ret;

netdev_dbg(dev, "no phy-handle found\n");
if (!priv->mdio) {
netdev_err(dev, "No phy-handle nor local mdio specified\n");
return -ENODEV;
}
phydev = connect_local_phy(dev);
if (phydev) {
ret = phylink_connect_phy(priv->phylink, phydev);
if (ret)
return -ENODEV;
}
phydev = connect_local_phy(dev);
if (phydev) {
ret = phylink_connect_phy(priv->phylink, phydev);
if (ret)
return -ENODEV;
}
}

if (!phydev) {
Expand Down