Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: aquantia/teranetics: Convert to use module_phy_driver macro

Use module_phy_driver macro to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Axel Lin and committed by
David S. Miller
fb0801dc 7f0abb1f

+2 -28
+1 -14
drivers/net/phy/aquantia.c
··· 171 171 }, 172 172 }; 173 173 174 - static int __init aquantia_init(void) 175 - { 176 - return phy_drivers_register(aquantia_driver, 177 - ARRAY_SIZE(aquantia_driver)); 178 - } 179 - 180 - static void __exit aquantia_exit(void) 181 - { 182 - return phy_drivers_unregister(aquantia_driver, 183 - ARRAY_SIZE(aquantia_driver)); 184 - } 185 - 186 - module_init(aquantia_init); 187 - module_exit(aquantia_exit); 174 + module_phy_driver(aquantia_driver); 188 175 189 176 static struct mdio_device_id __maybe_unused aquantia_tbl[] = { 190 177 { PHY_ID_AQ1202, 0xfffffff0 },
+1 -14
drivers/net/phy/teranetics.c
··· 112 112 }, 113 113 }; 114 114 115 - static int __init teranetics_init(void) 116 - { 117 - return phy_drivers_register(teranetics_driver, 118 - ARRAY_SIZE(teranetics_driver)); 119 - } 120 - 121 - static void __exit teranetics_exit(void) 122 - { 123 - return phy_drivers_unregister(teranetics_driver, 124 - ARRAY_SIZE(teranetics_driver)); 125 - } 126 - 127 - module_init(teranetics_init); 128 - module_exit(teranetics_exit); 115 + module_phy_driver(teranetics_driver); 129 116 130 117 static struct mdio_device_id __maybe_unused teranetics_tbl[] = { 131 118 { PHY_ID_TN2020, 0xffffffff },