Skip to content

Commit

Permalink
of: mdio: export of_mdiobus_child_is_phy
Browse files Browse the repository at this point in the history
This patch exports of_mdiobus_child_is_phy, allowing to check if a child
node is a network PHY.

Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
atenart authored and davem330 committed Dec 20, 2019
1 parent 0fd2600 commit 0aa4d01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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;

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

return false;
}
EXPORT_SYMBOL(of_mdiobus_child_is_phy);

/**
* of_mdiobus_register - Register mii_bus and create PHYs from the device tree
Expand Down
6 changes: 6 additions & 0 deletions include/linux/of_mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/of.h>

#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 struct phy_device *of_phy_find_device(struct device_node *phy_np);
extern struct phy_device *of_phy_connect(struct net_device *dev,
Expand Down Expand Up @@ -54,6 +55,11 @@ static inline int of_mdio_parse_addr(struct device *dev,
}

#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)
{
/*
Expand Down

0 comments on commit 0aa4d01

Please sign in to comment.