net: mdio: provide shim implementation of devm_of_mdiobus_register
Subsystems (4)
PATCH 1/1 net: mdio: provide shim implementation of devm_of_mdiobus_register
Similar to the way in which of_mdiobus_register() has a fallback to the non-DT based mdiobus_register() when CONFIG_OF is not set, we can create a shim for the device-managed devm_of_mdiobus_register() which calls devm_mdiobus_register() and discards the struct device_node *.
In particular, this solves a build issue with the qca8k DSA driver which uses devm_of_mdiobus_register and can be compiled without CONFIG_OF.
--- include/linux/of_mdio.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/linux/of_mdio.h +7 -0
@@ -72,6 +72,13 @@ static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *return mdiobus_register (mdio); } +static inline int devm_of_mdiobus_register (struct device *dev, +struct mii_bus *mdio, +struct device_node *np) +{ +return devm_mdiobus_register (dev, mdio); +} +static inline struct mdio_device *of_mdio_find_device (struct device_node *np) {return NULL ;
Signature · 1 line
2.25.1
Quoted 5 lines · Vladimir Oltean
Similar to the way in which
of_mdiobus_register()has a fallback to the non-DT basedmdiobus_register()whenCONFIG_OFis not set, we can create a shim for the device-manageddevm_of_mdiobus_register()which callsdevm_mdiobus_register()and discards the structdevice_node*.
Quoted 7 lines
In particular, this solves a build issue with the qca8k DSA driver which uses
devm_of_mdiobus_registerand can be compiled withoutCONFIG_OF.Reported-by Randy Dunlap <[email protected]>Signed-off-by Vladimir Oltean <[email protected]>Reviewed-by Andrew Lunn <[email protected]>
Signature · 1 line
Florian
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Tue, 18 May 2021 20:49:24 +0300 you wrote:
Similar to the way in which
of_mdiobus_register()has a fallback to the non-DT basedmdiobus_register()whenCONFIG_OFis not set, we can create a shim for the device-manageddevm_of_mdiobus_register()which callsdevm_mdiobus_register()and discards the structdevice_node*.In particular, this solves a build issue with the qca8k DSA driver which uses
devm_of_mdiobus_registerand can be compiled withoutCONFIG_OF.[...]
Here is the summary with links:
- [net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register
https://git.kernel.org/netdev/net-next/c/86544c3de6a2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html