Commit 0aa4d016 authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

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: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0fd26005
...@@ -162,7 +162,7 @@ static const struct of_device_id whitelist_phys[] = { ...@@ -162,7 +162,7 @@ static const struct of_device_id whitelist_phys[] = {
* A device which is not a phy is expected to have a compatible string * A device which is not a phy is expected to have a compatible string
* indicating what sort of device it is. * indicating what sort of device it is.
*/ */
static bool of_mdiobus_child_is_phy(struct device_node *child) bool of_mdiobus_child_is_phy(struct device_node *child)
{ {
u32 phy_id; u32 phy_id;
...@@ -187,6 +187,7 @@ static bool of_mdiobus_child_is_phy(struct device_node *child) ...@@ -187,6 +187,7 @@ static bool of_mdiobus_child_is_phy(struct device_node *child)
return false; return false;
} }
EXPORT_SYMBOL(of_mdiobus_child_is_phy);
/** /**
* of_mdiobus_register - Register mii_bus and create PHYs from the device tree * of_mdiobus_register - Register mii_bus and create PHYs from the device tree
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/of.h> #include <linux/of.h>
#if IS_ENABLED(CONFIG_OF_MDIO) #if IS_ENABLED(CONFIG_OF_MDIO)
extern bool of_mdiobus_child_is_phy(struct device_node *child);
extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
extern struct phy_device *of_phy_find_device(struct device_node *phy_np); extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
extern struct phy_device *of_phy_connect(struct net_device *dev, 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, ...@@ -54,6 +55,11 @@ static inline int of_mdio_parse_addr(struct device *dev,
} }
#else /* CONFIG_OF_MDIO */ #else /* CONFIG_OF_MDIO */
static bool of_mdiobus_child_is_phy(struct device_node *child)
{
return false;
}
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{ {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment