Commit d7cc3163 authored by Srikanth Thokala's avatar Srikanth Thokala Committed by David S. Miller

net: axienet: Support phy-less mode of operation

This patch adds proper checks to handle the PHY-less case.
Signed-off-by: default avatarSrikanth Thokala <sthokal@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f080a8c3
...@@ -940,10 +940,9 @@ static int axienet_open(struct net_device *ndev) ...@@ -940,10 +940,9 @@ static int axienet_open(struct net_device *ndev)
PHY_INTERFACE_MODE_RGMII_ID); PHY_INTERFACE_MODE_RGMII_ID);
} }
if (!lp->phy_dev) { if (!lp->phy_dev)
dev_err(lp->dev, "of_phy_connect() failed\n"); dev_err(lp->dev, "of_phy_connect() failed\n");
return -ENODEV; else
}
phy_start(lp->phy_dev); phy_start(lp->phy_dev);
} }
...@@ -1606,6 +1605,7 @@ static int axienet_of_probe(struct platform_device *op) ...@@ -1606,6 +1605,7 @@ static int axienet_of_probe(struct platform_device *op)
lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD;
lp->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0); lp->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0);
if (lp->phy_node)
ret = axienet_mdio_setup(lp, op->dev.of_node); ret = axienet_mdio_setup(lp, op->dev.of_node);
if (ret) if (ret)
dev_warn(&op->dev, "error registering MDIO bus\n"); dev_warn(&op->dev, "error registering MDIO bus\n");
......
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