diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2013-06-03 16:10:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-04 17:17:21 -0400 |
commit | 317420ab2370d7999ec6c324bc30b34dc57fe9d8 (patch) | |
tree | 3e6b72970e6250680f259faf97813b9410d414ba /drivers/net/phy/at803x.c | |
parent | d862e546142328d18377a4704be97f2ae301847a (diff) |
drivers: net: phy: at803x code cleanup on register and unregister driver
Make use of phy_drivers_register/phy_drivers_unregister to register/unregister
multiple phy drivers in a single module.
Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/at803x.c')
-rw-r--r-- | drivers/net/phy/at803x.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 45cbc10de01c..a1063e1bfc90 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c | |||
@@ -108,8 +108,9 @@ static int at803x_config_init(struct phy_device *phydev) | |||
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
111 | /* ATHEROS 8035 */ | 111 | static struct phy_driver at803x_driver[] = { |
112 | static struct phy_driver at8035_driver = { | 112 | { |
113 | /* ATHEROS 8035 */ | ||
113 | .phy_id = 0x004dd072, | 114 | .phy_id = 0x004dd072, |
114 | .name = "Atheros 8035 ethernet", | 115 | .name = "Atheros 8035 ethernet", |
115 | .phy_id_mask = 0xffffffef, | 116 | .phy_id_mask = 0xffffffef, |
@@ -121,10 +122,8 @@ static struct phy_driver at8035_driver = { | |||
121 | .driver = { | 122 | .driver = { |
122 | .owner = THIS_MODULE, | 123 | .owner = THIS_MODULE, |
123 | }, | 124 | }, |
124 | }; | 125 | }, { |
125 | 126 | /* ATHEROS 8030 */ | |
126 | /* ATHEROS 8030 */ | ||
127 | static struct phy_driver at8030_driver = { | ||
128 | .phy_id = 0x004dd076, | 127 | .phy_id = 0x004dd076, |
129 | .name = "Atheros 8030 ethernet", | 128 | .name = "Atheros 8030 ethernet", |
130 | .phy_id_mask = 0xffffffef, | 129 | .phy_id_mask = 0xffffffef, |
@@ -136,32 +135,18 @@ static struct phy_driver at8030_driver = { | |||
136 | .driver = { | 135 | .driver = { |
137 | .owner = THIS_MODULE, | 136 | .owner = THIS_MODULE, |
138 | }, | 137 | }, |
139 | }; | 138 | } }; |
140 | 139 | ||
141 | static int __init atheros_init(void) | 140 | static int __init atheros_init(void) |
142 | { | 141 | { |
143 | int ret; | 142 | return phy_drivers_register(at803x_driver, |
144 | 143 | ARRAY_SIZE(at803x_driver)); | |
145 | ret = phy_driver_register(&at8035_driver); | ||
146 | if (ret) | ||
147 | goto err1; | ||
148 | |||
149 | ret = phy_driver_register(&at8030_driver); | ||
150 | if (ret) | ||
151 | goto err2; | ||
152 | |||
153 | return 0; | ||
154 | |||
155 | err2: | ||
156 | phy_driver_unregister(&at8035_driver); | ||
157 | err1: | ||
158 | return ret; | ||
159 | } | 144 | } |
160 | 145 | ||
161 | static void __exit atheros_exit(void) | 146 | static void __exit atheros_exit(void) |
162 | { | 147 | { |
163 | phy_driver_unregister(&at8035_driver); | 148 | return phy_drivers_unregister(at803x_driver, |
164 | phy_driver_unregister(&at8030_driver); | 149 | ARRAY_SIZE(at803x_driver)); |
165 | } | 150 | } |
166 | 151 | ||
167 | module_init(atheros_init); | 152 | module_init(atheros_init); |