aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorPetri Gynther <pgynther@google.com>2014-10-06 14:38:30 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-07 13:06:45 -0400
commitfd2ef0ba3071c92ac6272ab22ea3f2b16d88a4eb (patch)
treee9d32e03bc599e39fb55b1b79269cbc08ae3ba20 /drivers/of
parent02c0fc1b8f41e6e895d6573615ba8ff549b685d2 (diff)
net: phy: adjust fixed_phy_register() return value
Adjust fixed_phy_register() to return struct phy_device *, so that it becomes easy to use fixed PHYs without device tree support: phydev = fixed_phy_register(PHY_POLL, &fixed_phy_status, NULL); fixed_phy_set_link_update(phydev, fixed_phy_link_update); phy_connect_direct(netdev, phydev, handler_fn, phy_interface); This change is a prerequisite for modifying bcmgenet driver to work without a device tree on Broadcom's MIPS-based 7xxx platforms. Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_mdio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index a85d80012993..1bd43053b8c7 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -286,6 +286,7 @@ int of_phy_register_fixed_link(struct device_node *np)
286 struct device_node *fixed_link_node; 286 struct device_node *fixed_link_node;
287 const __be32 *fixed_link_prop; 287 const __be32 *fixed_link_prop;
288 int len; 288 int len;
289 struct phy_device *phy;
289 290
290 /* New binding */ 291 /* New binding */
291 fixed_link_node = of_get_child_by_name(np, "fixed-link"); 292 fixed_link_node = of_get_child_by_name(np, "fixed-link");
@@ -299,7 +300,8 @@ int of_phy_register_fixed_link(struct device_node *np)
299 status.asym_pause = of_property_read_bool(fixed_link_node, 300 status.asym_pause = of_property_read_bool(fixed_link_node,
300 "asym-pause"); 301 "asym-pause");
301 of_node_put(fixed_link_node); 302 of_node_put(fixed_link_node);
302 return fixed_phy_register(PHY_POLL, &status, np); 303 phy = fixed_phy_register(PHY_POLL, &status, np);
304 return IS_ERR(phy) ? PTR_ERR(phy) : 0;
303 } 305 }
304 306
305 /* Old binding */ 307 /* Old binding */
@@ -310,7 +312,8 @@ int of_phy_register_fixed_link(struct device_node *np)
310 status.speed = be32_to_cpu(fixed_link_prop[2]); 312 status.speed = be32_to_cpu(fixed_link_prop[2]);
311 status.pause = be32_to_cpu(fixed_link_prop[3]); 313 status.pause = be32_to_cpu(fixed_link_prop[3]);
312 status.asym_pause = be32_to_cpu(fixed_link_prop[4]); 314 status.asym_pause = be32_to_cpu(fixed_link_prop[4]);
313 return fixed_phy_register(PHY_POLL, &status, np); 315 phy = fixed_phy_register(PHY_POLL, &status, np);
316 return IS_ERR(phy) ? PTR_ERR(phy) : 0;
314 } 317 }
315 318
316 return -ENODEV; 319 return -ENODEV;