Commit c7dfe3ab authored by Sebastian Frias's avatar Sebastian Frias Committed by David S. Miller

net: ethernet: nb8800: support fixed-link DT node

Under some circumstances, e.g. when connecting to a switch, the ethernet
port will not be connected to a PHY. In that case a "fixed-link" DT node
can be used to replace it.

https://stackoverflow.com/questions/31046172/device-tree-for-phy-less-connection-to-a-dsa-switch

This patch adds support for the "fixed-link" node to the nb8800 driver.
Signed-off-by: default avatarSebastian Frias <sf84@laposte.net>
Acked-by: default avatarMans Rullgard <mans@mansr.com>
Cc: Mason <slash.tmp@free.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fbb0fa8b
...@@ -1460,7 +1460,19 @@ static int nb8800_probe(struct platform_device *pdev) ...@@ -1460,7 +1460,19 @@ static int nb8800_probe(struct platform_device *pdev)
goto err_disable_clk; goto err_disable_clk;
} }
priv->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); if (of_phy_is_fixed_link(pdev->dev.of_node)) {
ret = of_phy_register_fixed_link(pdev->dev.of_node);
if (ret < 0) {
dev_err(&pdev->dev, "bad fixed-link spec\n");
goto err_free_bus;
}
priv->phy_node = of_node_get(pdev->dev.of_node);
}
if (!priv->phy_node)
priv->phy_node = of_parse_phandle(pdev->dev.of_node,
"phy-handle", 0);
if (!priv->phy_node) { if (!priv->phy_node) {
dev_err(&pdev->dev, "no PHY specified\n"); dev_err(&pdev->dev, "no PHY specified\n");
ret = -ENODEV; ret = -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