diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2015-03-10 16:57:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-11 17:56:28 -0400 |
commit | 33d6737761ea425d43f3b6e4561573a4020982f2 (patch) | |
tree | be03975d5adacb5c523a1c428c806a7b91e1a0dd /include/linux/of_mdio.h | |
parent | d26ea6cc48da5a97d8188220c334cf3669fa8dc7 (diff) | |
download | linux-33d6737761ea425d43f3b6e4561573a4020982f2.tar.gz linux-33d6737761ea425d43f3b6e4561573a4020982f2.tar.bz2 linux-33d6737761ea425d43f3b6e4561573a4020982f2.zip |
of: mdio: export of_mdio_parse_addr
Export of_mdio_parse_addr() which allows parsing a given Ethernet PHY
node MDIO address, verify it is within the allowed range, and return
its value. This is going to be useful for the DSA code which needs to
deal with multiple layers of MDIO buses.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/of_mdio.h')
-rw-r--r-- | include/linux/of_mdio.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index d449018d0726..8f2237eb3485 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h @@ -24,6 +24,7 @@ struct phy_device *of_phy_attach(struct net_device *dev, phy_interface_t iface); extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); +extern int of_mdio_parse_addr(struct device *dev, const struct device_node *np); #else /* CONFIG_OF */ static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) @@ -60,6 +61,12 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) { return NULL; } + +static inline int of_mdio_parse_addr(struct device *dev, + const struct device_node *np) +{ + return -ENOSYS; +} #endif /* CONFIG_OF */ #if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) |