Skip to content

Commit cab02b8

Browse files
atenartclaudiubeznea
authored andcommitted
of: mdio: export of_mdiobus_child_is_phy
This patch exports of_mdiobus_child_is_phy, allowing to check if a child node is a network PHY. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2cd2e9f commit cab02b8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/of/of_mdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static const struct of_device_id whitelist_phys[] = {
162162
* A device which is not a phy is expected to have a compatible string
163163
* indicating what sort of device it is.
164164
*/
165-
static bool of_mdiobus_child_is_phy(struct device_node *child)
165+
bool of_mdiobus_child_is_phy(struct device_node *child)
166166
{
167167
u32 phy_id;
168168

@@ -187,6 +187,7 @@ static bool of_mdiobus_child_is_phy(struct device_node *child)
187187

188188
return false;
189189
}
190+
EXPORT_SYMBOL(of_mdiobus_child_is_phy);
190191

191192
/**
192193
* of_mdiobus_register - Register mii_bus and create PHYs from the device tree

include/linux/of_mdio.h

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

1414
#if IS_ENABLED(CONFIG_OF_MDIO)
15+
extern bool of_mdiobus_child_is_phy(struct device_node *child);
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,
@@ -54,6 +55,11 @@ static inline int of_mdio_parse_addr(struct device *dev,
5455
}
5556

5657
#else /* CONFIG_OF_MDIO */
58+
static bool of_mdiobus_child_is_phy(struct device_node *child)
59+
{
60+
return false;
61+
}
62+
5763
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
5864
{
5965
/*

0 commit comments

Comments
 (0)