aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon/ethernet-mdio.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2016-02-14 02:45:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 16:52:15 -0800
commita25e278020bf4cf1d8183bb81f86ec7d73d16dca (patch)
treebea9341d06d3dbbb2615c3ec0c03a48281246180 /drivers/staging/octeon/ethernet-mdio.c
parentstaging: speakup: Fix block comment style (diff)
downloadlinux-dev-a25e278020bf4cf1d8183bb81f86ec7d73d16dca.tar.xz
linux-dev-a25e278020bf4cf1d8183bb81f86ec7d73d16dca.zip
staging: octeon: support fixed-link phys
Support fixed-link PHYs. This allows to remove some of the board-specific link cvmx_helper code in the future. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon/ethernet-mdio.c')
-rw-r--r--drivers/staging/octeon/ethernet-mdio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 55abd83c38b6..0ac11b1221b7 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -181,6 +181,15 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
goto no_phy;
phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
+ if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
+ int rc;
+
+ rc = of_phy_register_fixed_link(priv->of_node);
+ if (rc)
+ return rc;
+
+ phy_node = of_node_get(priv->of_node);
+ }
if (!phy_node)
goto no_phy;