Skip to content

Commit f9dc9ac

Browse files
Srinivas-Kandagatladavem330
authored andcommitted
of/mdio: Add dummy functions in of_mdio.h.
This patch adds dummy functions in of_mdio.h, so that driver need not ifdef there code with CONFIG_OF. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ee13040 commit f9dc9ac

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

include/linux/of_mdio.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/phy.h>
1313
#include <linux/of.h>
1414

15+
#ifdef CONFIG_OF
1516
extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
1617
extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
1718
extern struct phy_device *of_phy_connect(struct net_device *dev,
@@ -24,4 +25,36 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
2425

2526
extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
2627

28+
#else /* CONFIG_OF */
29+
int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
30+
{
31+
return -ENOSYS;
32+
}
33+
34+
struct phy_device *of_phy_find_device(struct device_node *phy_np)
35+
{
36+
return NULL;
37+
}
38+
39+
struct phy_device *of_phy_connect(struct net_device *dev,
40+
struct device_node *phy_np,
41+
void (*hndlr)(struct net_device *),
42+
u32 flags, phy_interface_t iface)
43+
{
44+
return NULL;
45+
}
46+
47+
struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48+
void (*hndlr)(struct net_device *),
49+
phy_interface_t iface)
50+
{
51+
return NULL;
52+
}
53+
54+
struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
55+
{
56+
return NULL;
57+
}
58+
#endif /* CONFIG_OF */
59+
2760
#endif /* __LINUX_OF_MDIO_H */

0 commit comments

Comments
 (0)