net: mdio: use macro module_driver to avoid boilerplate code
Subsystems (3)
Heiner Kallweit
maintainerPATCH 1/1 net: mdio: use macro module_driver to avoid boilerplate code
Use macro module_driver to avoid boilerplate code.
Signed-off-by Heiner Kallweit <[email protected]>
--- include/linux/mdio.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
include/linux/mdio.h +2 -11
@@ -689,16 +689,7 @@ struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr);* init/exit. Each module may only use this macro once, and calling it * replaces module_init() and module_exit(). */ -#define mdio_module_driver (_mdio_driver) \ -static int __init mdio_module_init(void) \ -{ \ - return mdio_driver_register(&_mdio_driver); \ -} \ -module_init(mdio_module_init); \ -static void __exit mdio_module_exit(void) \ -{ \ - mdio_driver_unregister(&_mdio_driver); \ -} \ -module_exit(mdio_module_exit) +#define mdio_module_driver (_mdio_driver) \ + module_driver(_mdio_driver, mdio_driver_register, mdio_driver_unregister)#endif /* __LINUX_MDIO_H__ */
Signature · 1 line
2.51.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Mon, 13 Oct 2025 22:50:27 +0200 you wrote:
Use macro
module_driverto avoid boilerplate code.Signed-off-by Heiner Kallweit <[email protected]>--- include/linux/mdio.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
Here is the summary with links:
- [net-next] net: mdio: use macro module_driver to avoid boilerplate code
https://git.kernel.org/netdev/net-next/c/10c4b4f60f5d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html