Re: [PATCH v3] net: ethernet: support "fixed-link" DT node on nb8800 driver

From: Sebastian Frias
Date: Fri Feb 05 2016 - 09:56:37 EST


On 02/05/2016 03:34 PM, Måns Rullgård wrote:
Sebastian Frias <sf84@xxxxxxxxxxx> writes:

Signed-off-by: Sebastian Frias <sf84@xxxxxxxxxxx>

Please change the subject to something like "net: ethernet: nb8800:
support fixed-link DT node" and add a comment body.

The subject is pretty explicit for such a simple patch, what else could I add that wouldn't be unnecessary chat?


---
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 ecc4a33..e1fb071 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.1.4