mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: mdio: use macro module_driver to avoid boilerplate code
Use macro module_driver to avoid boilerplate code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/e5c37417-4984-4b57-8154-264deef61e0d@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
bdec4271e8
commit
10c4b4f60f
@@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user