diff options
author | Daniel Mack <zonque@gmail.com> | 2014-05-06 12:52:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-07 17:16:35 -0400 |
commit | 23a456f05353035d1a2b3f1b9a92707acdc036e0 (patch) | |
tree | 24de32c9862c164c333184da26c0ca5439377657 | |
parent | aeefa1ecfc799b0ea2c4979617f14cecd5cccbfd (diff) |
net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF
If CONFIG_OF is not set, make of_mdiobus_register() call
mdiobus_register() instead of returning -ENOSYS.
This way, we can just call of_mdiobus_register() from all DT-enabled
drivers to handle the compat cases.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/of_mdio.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 6fe8464ed767..881a7c3571f4 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
@@ -31,7 +31,12 @@ extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); | |||
31 | #else /* CONFIG_OF */ | 31 | #else /* CONFIG_OF */ |
32 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | 32 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) |
33 | { | 33 | { |
34 | return -ENOSYS; | 34 | /* |
35 | * Fall back to the non-DT function to register a bus. | ||
36 | * This way, we don't have to keep compat bits around in drivers. | ||
37 | */ | ||
38 | |||
39 | return mdiobus_register(mdio); | ||
35 | } | 40 | } |
36 | 41 | ||
37 | static inline struct phy_device *of_phy_find_device(struct device_node *phy_np) | 42 | static inline struct phy_device *of_phy_find_device(struct device_node *phy_np) |