netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: support "fixed-link" DT node on nb8800 driver
@ 2016-02-05 13:31 Sebastian Frias
  2016-02-05 13:39 ` Måns Rullgård
  0 siblings, 1 reply; 26+ messages in thread
From: Sebastian Frias @ 2016-02-05 13:31 UTC (permalink / raw)
  To: Måns Rullgård, David S. Miller, netdev; +Cc: LKML, mason


Signed-off-by: Sebastian Frias <sf84@laposte.net>
---
  drivers/net/ethernet/aurora/nb8800.c | 19 +++++++++++++++----
  1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/aurora/nb8800.c 
b/drivers/net/ethernet/aurora/nb8800.c
index ecc4a33..1353fee 100644
--- a/drivers/net/ethernet/aurora/nb8800.c
+++ b/drivers/net/ethernet/aurora/nb8800.c
@@ -1461,10 +1461,21 @@ static int nb8800_probe(struct platform_device 
*pdev)
  	}

  	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;
-		goto err_free_bus;
+	if (!priv->phy_node)
+	{
+		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, "broken fixed-link specification\n");
+				goto err_free_bus;
+			}
+			priv->phy_node = of_node_get(pdev->dev.of_node);
+		}
+		else {
+			dev_err(&pdev->dev, "no PHY specified\n");
+			ret = -ENODEV;
+			goto err_free_bus;
+		}
  	}

  	priv->mii_bus = bus;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-02-22 12:39 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05 13:31 [PATCH] net: ethernet: support "fixed-link" DT node on nb8800 driver Sebastian Frias
2016-02-05 13:39 ` Måns Rullgård
2016-02-05 13:49   ` [PATCH v2] net: ethernet: support "fixed-link" DT key/node " Sebastian Frias
2016-02-05 13:58     ` Måns Rullgård
2016-02-05 14:08       ` Sebastian Frias
2016-02-05 14:13         ` Måns Rullgård
2016-02-05 14:22           ` [PATCH v3] net: ethernet: support "fixed-link" DT node " Sebastian Frias
2016-02-05 14:34             ` Måns Rullgård
2016-02-05 14:56               ` Sebastian Frias
2016-02-05 15:08                 ` Måns Rullgård
2016-02-05 15:20                   ` Sebastian Frias
2016-02-05 15:26                     ` Måns Rullgård
2016-02-08 10:23                       ` [PATCH v5] net: ethernet: nb8800: support fixed-link DT node Sebastian Frias
2016-02-08 13:19                         ` Måns Rullgård
2016-02-16 20:04                         ` David Miller
2016-02-22 12:39                           ` Mason
2016-02-08 10:34                       ` [PATCH v3] net: ethernet: support "fixed-link" DT node on nb8800 driver Sebastian Frias
2016-02-08 13:37                         ` Måns Rullgård
2016-02-08 14:11                           ` Mason
2016-02-08 14:38                             ` Sebastian Frias
2016-02-08 14:44                               ` Måns Rullgård
2016-02-08 14:32                           ` Sebastian Frias
2016-02-08 14:50                             ` Måns Rullgård
2016-02-05 14:56               ` [PATCH v4] net: ethernet: nb8800: support fixed-link DT node Sebastian Frias
2016-02-05 15:57   ` [PATCH] net: ethernet: support "fixed-link" DT node on nb8800 driver Andy Shevchenko
2016-02-05 15:58     ` Måns Rullgård

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).