aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_mdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/of_mdio.h')
-rw-r--r--include/linux/of_mdio.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 6fe8464ed767..d449018d0726 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -22,16 +22,18 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
22struct phy_device *of_phy_attach(struct net_device *dev, 22struct phy_device *of_phy_attach(struct net_device *dev,
23 struct device_node *phy_np, u32 flags, 23 struct device_node *phy_np, u32 flags,
24 phy_interface_t iface); 24 phy_interface_t iface);
25extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
26 void (*hndlr)(struct net_device *),
27 phy_interface_t iface);
28 25
29extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
30 27
31#else /* CONFIG_OF */ 28#else /* CONFIG_OF */
32static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) 29static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
33{ 30{
34 return -ENOSYS; 31 /*
32 * Fall back to the non-DT function to register a bus.
33 * This way, we don't have to keep compat bits around in drivers.
34 */
35
36 return mdiobus_register(mdio);
35} 37}
36 38
37static inline struct phy_device *of_phy_find_device(struct device_node *phy_np) 39static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
@@ -54,17 +56,25 @@ static inline struct phy_device *of_phy_attach(struct net_device *dev,
54 return NULL; 56 return NULL;
55} 57}
56 58
57static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 59static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
58 void (*hndlr)(struct net_device *),
59 phy_interface_t iface)
60{ 60{
61 return NULL; 61 return NULL;
62} 62}
63#endif /* CONFIG_OF */
63 64
64static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) 65#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY)
66extern int of_phy_register_fixed_link(struct device_node *np);
67extern bool of_phy_is_fixed_link(struct device_node *np);
68#else
69static inline int of_phy_register_fixed_link(struct device_node *np)
65{ 70{
66 return NULL; 71 return -ENOSYS;
67} 72}
68#endif /* CONFIG_OF */ 73static inline bool of_phy_is_fixed_link(struct device_node *np)
74{
75 return false;
76}
77#endif
78
69 79
70#endif /* __LINUX_OF_MDIO_H */ 80#endif /* __LINUX_OF_MDIO_H */