* [PATCH v6] net: ethernet: nb8800: support fixed-link DT node
@ 2016-02-22 12:33 Mason
2016-02-24 16:32 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Mason @ 2016-02-22 12:33 UTC (permalink / raw)
To: David S. Miller; +Cc: Sebastian Frias, Mans Rullgard, netdev
From: Sebastian Frias <sf84@laposte.net>
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: Sebastian Frias <sf84@laposte.net>
Acked-by: Mans Rullgard <mans@mansr.com>
Cc: Mason <slash.tmp@free.fr>
---
There were spurious spaces in the previous patch.
---
drivers/net/ethernet/aurora/nb8800.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
index f71ab2647a3b..08a23e6b60e9 100644
--- a/drivers/net/ethernet/aurora/nb8800.c
+++ b/drivers/net/ethernet/aurora/nb8800.c
@@ -1460,7 +1460,19 @@ static int nb8800_probe(struct platform_device *pdev)
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) {
dev_err(&pdev->dev, "no PHY specified\n");
ret = -ENODEV;
--
2.7.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v6] net: ethernet: nb8800: support fixed-link DT node
2016-02-22 12:33 [PATCH v6] net: ethernet: nb8800: support fixed-link DT node Mason
@ 2016-02-24 16:32 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-02-24 16:32 UTC (permalink / raw)
To: slash.tmp; +Cc: sf84, mans, netdev
From: Mason <slash.tmp@free.fr>
Date: Mon, 22 Feb 2016 13:33:14 +0100
> From: Sebastian Frias <sf84@laposte.net>
>
> 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: Sebastian Frias <sf84@laposte.net>
> Acked-by: Mans Rullgard <mans@mansr.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-24 16:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-22 12:33 [PATCH v6] net: ethernet: nb8800: support fixed-link DT node Mason
2016-02-24 16:32 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.