aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-01-06 14:11:22 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-07 14:31:27 -0500
commitbe01da72b1b832b89fbdf59ae6f1b60e53ca2987 (patch)
treee21e0cd75a0e602153fb669e603170832aa825ce
parentbc87922ff59d364a33e9bce0febdef21a7fbd2af (diff)
phy: Centralize setting driver module owner
Rather than have each driver set the driver owner field, do it once in the core code. This will also help with later changes, when the device structure will move. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/amd.c1
-rw-r--r--drivers/net/phy/aquantia.c4
-rw-r--r--drivers/net/phy/at803x.c9
-rw-r--r--drivers/net/phy/bcm63xx.c2
-rw-r--r--drivers/net/phy/bcm7xxx.c6
-rw-r--r--drivers/net/phy/bcm87xx.c2
-rw-r--r--drivers/net/phy/broadcom.c12
-rw-r--r--drivers/net/phy/cicada.c2
-rw-r--r--drivers/net/phy/davicom.c4
-rw-r--r--drivers/net/phy/dp83640.c3
-rw-r--r--drivers/net/phy/dp83848.c2
-rw-r--r--drivers/net/phy/dp83867.c2
-rw-r--r--drivers/net/phy/et1011c.c1
-rw-r--r--drivers/net/phy/icplus.c3
-rw-r--r--drivers/net/phy/lxt.c4
-rw-r--r--drivers/net/phy/marvell.c13
-rw-r--r--drivers/net/phy/micrel.c13
-rw-r--r--drivers/net/phy/microchip.c2
-rw-r--r--drivers/net/phy/national.c1
-rw-r--r--drivers/net/phy/phy_device.c13
-rw-r--r--drivers/net/phy/qsemi.c1
-rw-r--r--drivers/net/phy/realtek.c5
-rw-r--r--drivers/net/phy/smsc.c10
-rw-r--r--drivers/net/phy/ste10Xp.c2
-rw-r--r--drivers/net/phy/teranetics.c1
-rw-r--r--drivers/net/phy/vitesse.c8
-rw-r--r--include/linux/phy.h7
27 files changed, 12 insertions, 121 deletions
diff --git a/drivers/net/phy/amd.c b/drivers/net/phy/amd.c
index 65a488f82eb8..18141c022b13 100644
--- a/drivers/net/phy/amd.c
+++ b/drivers/net/phy/amd.c
@@ -72,7 +72,6 @@ static struct phy_driver am79c_driver[] = { {
72 .read_status = genphy_read_status, 72 .read_status = genphy_read_status,
73 .ack_interrupt = am79c_ack_interrupt, 73 .ack_interrupt = am79c_ack_interrupt,
74 .config_intr = am79c_config_intr, 74 .config_intr = am79c_config_intr,
75 .driver = { .owner = THIS_MODULE,},
76} }; 75} };
77 76
78module_phy_driver(am79c_driver); 77module_phy_driver(am79c_driver);
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index f1936b7a7af6..09b0b0aa8d68 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -128,7 +128,6 @@ static struct phy_driver aquantia_driver[] = {
128 .config_intr = aquantia_config_intr, 128 .config_intr = aquantia_config_intr,
129 .ack_interrupt = aquantia_ack_interrupt, 129 .ack_interrupt = aquantia_ack_interrupt,
130 .read_status = aquantia_read_status, 130 .read_status = aquantia_read_status,
131 .driver = { .owner = THIS_MODULE,},
132}, 131},
133{ 132{
134 .phy_id = PHY_ID_AQ2104, 133 .phy_id = PHY_ID_AQ2104,
@@ -141,7 +140,6 @@ static struct phy_driver aquantia_driver[] = {
141 .config_intr = aquantia_config_intr, 140 .config_intr = aquantia_config_intr,
142 .ack_interrupt = aquantia_ack_interrupt, 141 .ack_interrupt = aquantia_ack_interrupt,
143 .read_status = aquantia_read_status, 142 .read_status = aquantia_read_status,
144 .driver = { .owner = THIS_MODULE,},
145}, 143},
146{ 144{
147 .phy_id = PHY_ID_AQR105, 145 .phy_id = PHY_ID_AQR105,
@@ -154,7 +152,6 @@ static struct phy_driver aquantia_driver[] = {
154 .config_intr = aquantia_config_intr, 152 .config_intr = aquantia_config_intr,
155 .ack_interrupt = aquantia_ack_interrupt, 153 .ack_interrupt = aquantia_ack_interrupt,
156 .read_status = aquantia_read_status, 154 .read_status = aquantia_read_status,
157 .driver = { .owner = THIS_MODULE,},
158}, 155},
159{ 156{
160 .phy_id = PHY_ID_AQR405, 157 .phy_id = PHY_ID_AQR405,
@@ -167,7 +164,6 @@ static struct phy_driver aquantia_driver[] = {
167 .config_intr = aquantia_config_intr, 164 .config_intr = aquantia_config_intr,
168 .ack_interrupt = aquantia_ack_interrupt, 165 .ack_interrupt = aquantia_ack_interrupt,
169 .read_status = aquantia_read_status, 166 .read_status = aquantia_read_status,
170 .driver = { .owner = THIS_MODULE,},
171}, 167},
172}; 168};
173 169
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index b76ac09a554f..8a8f6fb2880d 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -310,9 +310,6 @@ static struct phy_driver at803x_driver[] = {
310 .read_status = genphy_read_status, 310 .read_status = genphy_read_status,
311 .ack_interrupt = at803x_ack_interrupt, 311 .ack_interrupt = at803x_ack_interrupt,
312 .config_intr = at803x_config_intr, 312 .config_intr = at803x_config_intr,
313 .driver = {
314 .owner = THIS_MODULE,
315 },
316}, { 313}, {
317 /* ATHEROS 8030 */ 314 /* ATHEROS 8030 */
318 .phy_id = ATH8030_PHY_ID, 315 .phy_id = ATH8030_PHY_ID,
@@ -331,9 +328,6 @@ static struct phy_driver at803x_driver[] = {
331 .read_status = genphy_read_status, 328 .read_status = genphy_read_status,
332 .ack_interrupt = at803x_ack_interrupt, 329 .ack_interrupt = at803x_ack_interrupt,
333 .config_intr = at803x_config_intr, 330 .config_intr = at803x_config_intr,
334 .driver = {
335 .owner = THIS_MODULE,
336 },
337}, { 331}, {
338 /* ATHEROS 8031 */ 332 /* ATHEROS 8031 */
339 .phy_id = ATH8031_PHY_ID, 333 .phy_id = ATH8031_PHY_ID,
@@ -352,9 +346,6 @@ static struct phy_driver at803x_driver[] = {
352 .read_status = genphy_read_status, 346 .read_status = genphy_read_status,
353 .ack_interrupt = &at803x_ack_interrupt, 347 .ack_interrupt = &at803x_ack_interrupt,
354 .config_intr = &at803x_config_intr, 348 .config_intr = &at803x_config_intr,
355 .driver = {
356 .owner = THIS_MODULE,
357 },
358} }; 349} };
359 350
360module_phy_driver(at803x_driver); 351module_phy_driver(at803x_driver);
diff --git a/drivers/net/phy/bcm63xx.c b/drivers/net/phy/bcm63xx.c
index 86b28052bf06..e741bf614c4e 100644
--- a/drivers/net/phy/bcm63xx.c
+++ b/drivers/net/phy/bcm63xx.c
@@ -56,7 +56,6 @@ static struct phy_driver bcm63xx_driver[] = {
56 .read_status = genphy_read_status, 56 .read_status = genphy_read_status,
57 .ack_interrupt = bcm_phy_ack_intr, 57 .ack_interrupt = bcm_phy_ack_intr,
58 .config_intr = bcm_phy_config_intr, 58 .config_intr = bcm_phy_config_intr,
59 .driver = { .owner = THIS_MODULE },
60}, { 59}, {
61 /* same phy as above, with just a different OUI */ 60 /* same phy as above, with just a different OUI */
62 .phy_id = 0x002bdc00, 61 .phy_id = 0x002bdc00,
@@ -69,7 +68,6 @@ static struct phy_driver bcm63xx_driver[] = {
69 .read_status = genphy_read_status, 68 .read_status = genphy_read_status,
70 .ack_interrupt = bcm_phy_ack_intr, 69 .ack_interrupt = bcm_phy_ack_intr,
71 .config_intr = bcm_phy_config_intr, 70 .config_intr = bcm_phy_config_intr,
72 .driver = { .owner = THIS_MODULE },
73} }; 71} };
74 72
75module_phy_driver(bcm63xx_driver); 73module_phy_driver(bcm63xx_driver);
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 9f4e6eb886af..bf241a3ec5e5 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -324,7 +324,6 @@ static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
324 .config_aneg = genphy_config_aneg, \ 324 .config_aneg = genphy_config_aneg, \
325 .read_status = genphy_read_status, \ 325 .read_status = genphy_read_status, \
326 .resume = bcm7xxx_28nm_resume, \ 326 .resume = bcm7xxx_28nm_resume, \
327 .driver = { .owner = THIS_MODULE }, \
328} 327}
329 328
330static struct phy_driver bcm7xxx_driver[] = { 329static struct phy_driver bcm7xxx_driver[] = {
@@ -346,7 +345,6 @@ static struct phy_driver bcm7xxx_driver[] = {
346 .read_status = genphy_read_status, 345 .read_status = genphy_read_status,
347 .suspend = bcm7xxx_suspend, 346 .suspend = bcm7xxx_suspend,
348 .resume = bcm7xxx_config_init, 347 .resume = bcm7xxx_config_init,
349 .driver = { .owner = THIS_MODULE },
350}, { 348}, {
351 .phy_id = PHY_ID_BCM7429, 349 .phy_id = PHY_ID_BCM7429,
352 .phy_id_mask = 0xfffffff0, 350 .phy_id_mask = 0xfffffff0,
@@ -359,7 +357,6 @@ static struct phy_driver bcm7xxx_driver[] = {
359 .read_status = genphy_read_status, 357 .read_status = genphy_read_status,
360 .suspend = bcm7xxx_suspend, 358 .suspend = bcm7xxx_suspend,
361 .resume = bcm7xxx_config_init, 359 .resume = bcm7xxx_config_init,
362 .driver = { .owner = THIS_MODULE },
363}, { 360}, {
364 .phy_id = PHY_ID_BCM7435, 361 .phy_id = PHY_ID_BCM7435,
365 .phy_id_mask = 0xfffffff0, 362 .phy_id_mask = 0xfffffff0,
@@ -372,7 +369,6 @@ static struct phy_driver bcm7xxx_driver[] = {
372 .read_status = genphy_read_status, 369 .read_status = genphy_read_status,
373 .suspend = bcm7xxx_suspend, 370 .suspend = bcm7xxx_suspend,
374 .resume = bcm7xxx_config_init, 371 .resume = bcm7xxx_config_init,
375 .driver = { .owner = THIS_MODULE },
376}, { 372}, {
377 .phy_id = PHY_BCM_OUI_4, 373 .phy_id = PHY_BCM_OUI_4,
378 .phy_id_mask = 0xffff0000, 374 .phy_id_mask = 0xffff0000,
@@ -385,7 +381,6 @@ static struct phy_driver bcm7xxx_driver[] = {
385 .read_status = genphy_read_status, 381 .read_status = genphy_read_status,
386 .suspend = bcm7xxx_suspend, 382 .suspend = bcm7xxx_suspend,
387 .resume = bcm7xxx_config_init, 383 .resume = bcm7xxx_config_init,
388 .driver = { .owner = THIS_MODULE },
389}, { 384}, {
390 .phy_id = PHY_BCM_OUI_5, 385 .phy_id = PHY_BCM_OUI_5,
391 .phy_id_mask = 0xffffff00, 386 .phy_id_mask = 0xffffff00,
@@ -398,7 +393,6 @@ static struct phy_driver bcm7xxx_driver[] = {
398 .read_status = genphy_read_status, 393 .read_status = genphy_read_status,
399 .suspend = bcm7xxx_suspend, 394 .suspend = bcm7xxx_suspend,
400 .resume = bcm7xxx_config_init, 395 .resume = bcm7xxx_config_init,
401 .driver = { .owner = THIS_MODULE },
402} }; 396} };
403 397
404static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { 398static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
diff --git a/drivers/net/phy/bcm87xx.c b/drivers/net/phy/bcm87xx.c
index e536e30d1643..f7ebdcff53e4 100644
--- a/drivers/net/phy/bcm87xx.c
+++ b/drivers/net/phy/bcm87xx.c
@@ -201,7 +201,6 @@ static struct phy_driver bcm87xx_driver[] = {
201 .config_intr = bcm87xx_config_intr, 201 .config_intr = bcm87xx_config_intr,
202 .did_interrupt = bcm87xx_did_interrupt, 202 .did_interrupt = bcm87xx_did_interrupt,
203 .match_phy_device = bcm8706_match_phy_device, 203 .match_phy_device = bcm8706_match_phy_device,
204 .driver = { .owner = THIS_MODULE },
205}, { 204}, {
206 .phy_id = PHY_ID_BCM8727, 205 .phy_id = PHY_ID_BCM8727,
207 .phy_id_mask = 0xffffffff, 206 .phy_id_mask = 0xffffffff,
@@ -214,7 +213,6 @@ static struct phy_driver bcm87xx_driver[] = {
214 .config_intr = bcm87xx_config_intr, 213 .config_intr = bcm87xx_config_intr,
215 .did_interrupt = bcm87xx_did_interrupt, 214 .did_interrupt = bcm87xx_did_interrupt,
216 .match_phy_device = bcm8727_match_phy_device, 215 .match_phy_device = bcm8727_match_phy_device,
217 .driver = { .owner = THIS_MODULE },
218} }; 216} };
219 217
220module_phy_driver(bcm87xx_driver); 218module_phy_driver(bcm87xx_driver);
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 3ce5d9514623..870327efccf7 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -460,7 +460,6 @@ static struct phy_driver broadcom_drivers[] = {
460 .read_status = genphy_read_status, 460 .read_status = genphy_read_status,
461 .ack_interrupt = bcm_phy_ack_intr, 461 .ack_interrupt = bcm_phy_ack_intr,
462 .config_intr = bcm_phy_config_intr, 462 .config_intr = bcm_phy_config_intr,
463 .driver = { .owner = THIS_MODULE },
464}, { 463}, {
465 .phy_id = PHY_ID_BCM5421, 464 .phy_id = PHY_ID_BCM5421,
466 .phy_id_mask = 0xfffffff0, 465 .phy_id_mask = 0xfffffff0,
@@ -473,7 +472,6 @@ static struct phy_driver broadcom_drivers[] = {
473 .read_status = genphy_read_status, 472 .read_status = genphy_read_status,
474 .ack_interrupt = bcm_phy_ack_intr, 473 .ack_interrupt = bcm_phy_ack_intr,
475 .config_intr = bcm_phy_config_intr, 474 .config_intr = bcm_phy_config_intr,
476 .driver = { .owner = THIS_MODULE },
477}, { 475}, {
478 .phy_id = PHY_ID_BCM5461, 476 .phy_id = PHY_ID_BCM5461,
479 .phy_id_mask = 0xfffffff0, 477 .phy_id_mask = 0xfffffff0,
@@ -486,7 +484,6 @@ static struct phy_driver broadcom_drivers[] = {
486 .read_status = genphy_read_status, 484 .read_status = genphy_read_status,
487 .ack_interrupt = bcm_phy_ack_intr, 485 .ack_interrupt = bcm_phy_ack_intr,
488 .config_intr = bcm_phy_config_intr, 486 .config_intr = bcm_phy_config_intr,
489 .driver = { .owner = THIS_MODULE },
490}, { 487}, {
491 .phy_id = PHY_ID_BCM54616S, 488 .phy_id = PHY_ID_BCM54616S,
492 .phy_id_mask = 0xfffffff0, 489 .phy_id_mask = 0xfffffff0,
@@ -499,7 +496,6 @@ static struct phy_driver broadcom_drivers[] = {
499 .read_status = genphy_read_status, 496 .read_status = genphy_read_status,
500 .ack_interrupt = bcm_phy_ack_intr, 497 .ack_interrupt = bcm_phy_ack_intr,
501 .config_intr = bcm_phy_config_intr, 498 .config_intr = bcm_phy_config_intr,
502 .driver = { .owner = THIS_MODULE },
503}, { 499}, {
504 .phy_id = PHY_ID_BCM5464, 500 .phy_id = PHY_ID_BCM5464,
505 .phy_id_mask = 0xfffffff0, 501 .phy_id_mask = 0xfffffff0,
@@ -512,7 +508,6 @@ static struct phy_driver broadcom_drivers[] = {
512 .read_status = genphy_read_status, 508 .read_status = genphy_read_status,
513 .ack_interrupt = bcm_phy_ack_intr, 509 .ack_interrupt = bcm_phy_ack_intr,
514 .config_intr = bcm_phy_config_intr, 510 .config_intr = bcm_phy_config_intr,
515 .driver = { .owner = THIS_MODULE },
516}, { 511}, {
517 .phy_id = PHY_ID_BCM5481, 512 .phy_id = PHY_ID_BCM5481,
518 .phy_id_mask = 0xfffffff0, 513 .phy_id_mask = 0xfffffff0,
@@ -525,7 +520,6 @@ static struct phy_driver broadcom_drivers[] = {
525 .read_status = genphy_read_status, 520 .read_status = genphy_read_status,
526 .ack_interrupt = bcm_phy_ack_intr, 521 .ack_interrupt = bcm_phy_ack_intr,
527 .config_intr = bcm_phy_config_intr, 522 .config_intr = bcm_phy_config_intr,
528 .driver = { .owner = THIS_MODULE },
529}, { 523}, {
530 .phy_id = PHY_ID_BCM5482, 524 .phy_id = PHY_ID_BCM5482,
531 .phy_id_mask = 0xfffffff0, 525 .phy_id_mask = 0xfffffff0,
@@ -538,7 +532,6 @@ static struct phy_driver broadcom_drivers[] = {
538 .read_status = bcm5482_read_status, 532 .read_status = bcm5482_read_status,
539 .ack_interrupt = bcm_phy_ack_intr, 533 .ack_interrupt = bcm_phy_ack_intr,
540 .config_intr = bcm_phy_config_intr, 534 .config_intr = bcm_phy_config_intr,
541 .driver = { .owner = THIS_MODULE },
542}, { 535}, {
543 .phy_id = PHY_ID_BCM50610, 536 .phy_id = PHY_ID_BCM50610,
544 .phy_id_mask = 0xfffffff0, 537 .phy_id_mask = 0xfffffff0,
@@ -551,7 +544,6 @@ static struct phy_driver broadcom_drivers[] = {
551 .read_status = genphy_read_status, 544 .read_status = genphy_read_status,
552 .ack_interrupt = bcm_phy_ack_intr, 545 .ack_interrupt = bcm_phy_ack_intr,
553 .config_intr = bcm_phy_config_intr, 546 .config_intr = bcm_phy_config_intr,
554 .driver = { .owner = THIS_MODULE },
555}, { 547}, {
556 .phy_id = PHY_ID_BCM50610M, 548 .phy_id = PHY_ID_BCM50610M,
557 .phy_id_mask = 0xfffffff0, 549 .phy_id_mask = 0xfffffff0,
@@ -564,7 +556,6 @@ static struct phy_driver broadcom_drivers[] = {
564 .read_status = genphy_read_status, 556 .read_status = genphy_read_status,
565 .ack_interrupt = bcm_phy_ack_intr, 557 .ack_interrupt = bcm_phy_ack_intr,
566 .config_intr = bcm_phy_config_intr, 558 .config_intr = bcm_phy_config_intr,
567 .driver = { .owner = THIS_MODULE },
568}, { 559}, {
569 .phy_id = PHY_ID_BCM57780, 560 .phy_id = PHY_ID_BCM57780,
570 .phy_id_mask = 0xfffffff0, 561 .phy_id_mask = 0xfffffff0,
@@ -577,7 +568,6 @@ static struct phy_driver broadcom_drivers[] = {
577 .read_status = genphy_read_status, 568 .read_status = genphy_read_status,
578 .ack_interrupt = bcm_phy_ack_intr, 569 .ack_interrupt = bcm_phy_ack_intr,
579 .config_intr = bcm_phy_config_intr, 570 .config_intr = bcm_phy_config_intr,
580 .driver = { .owner = THIS_MODULE },
581}, { 571}, {
582 .phy_id = PHY_ID_BCMAC131, 572 .phy_id = PHY_ID_BCMAC131,
583 .phy_id_mask = 0xfffffff0, 573 .phy_id_mask = 0xfffffff0,
@@ -590,7 +580,6 @@ static struct phy_driver broadcom_drivers[] = {
590 .read_status = genphy_read_status, 580 .read_status = genphy_read_status,
591 .ack_interrupt = brcm_fet_ack_interrupt, 581 .ack_interrupt = brcm_fet_ack_interrupt,
592 .config_intr = brcm_fet_config_intr, 582 .config_intr = brcm_fet_config_intr,
593 .driver = { .owner = THIS_MODULE },
594}, { 583}, {
595 .phy_id = PHY_ID_BCM5241, 584 .phy_id = PHY_ID_BCM5241,
596 .phy_id_mask = 0xfffffff0, 585 .phy_id_mask = 0xfffffff0,
@@ -603,7 +592,6 @@ static struct phy_driver broadcom_drivers[] = {
603 .read_status = genphy_read_status, 592 .read_status = genphy_read_status,
604 .ack_interrupt = brcm_fet_ack_interrupt, 593 .ack_interrupt = brcm_fet_ack_interrupt,
605 .config_intr = brcm_fet_config_intr, 594 .config_intr = brcm_fet_config_intr,
606 .driver = { .owner = THIS_MODULE },
607} }; 595} };
608 596
609module_phy_driver(broadcom_drivers); 597module_phy_driver(broadcom_drivers);
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
index 27f5464899d4..d339c1afea77 100644
--- a/drivers/net/phy/cicada.c
+++ b/drivers/net/phy/cicada.c
@@ -114,7 +114,6 @@ static struct phy_driver cis820x_driver[] = {
114 .read_status = &genphy_read_status, 114 .read_status = &genphy_read_status,
115 .ack_interrupt = &cis820x_ack_interrupt, 115 .ack_interrupt = &cis820x_ack_interrupt,
116 .config_intr = &cis820x_config_intr, 116 .config_intr = &cis820x_config_intr,
117 .driver = { .owner = THIS_MODULE,},
118}, { 117}, {
119 .phy_id = 0x000fc440, 118 .phy_id = 0x000fc440,
120 .name = "Cicada Cis8204", 119 .name = "Cicada Cis8204",
@@ -126,7 +125,6 @@ static struct phy_driver cis820x_driver[] = {
126 .read_status = &genphy_read_status, 125 .read_status = &genphy_read_status,
127 .ack_interrupt = &cis820x_ack_interrupt, 126 .ack_interrupt = &cis820x_ack_interrupt,
128 .config_intr = &cis820x_config_intr, 127 .config_intr = &cis820x_config_intr,
129 .driver = { .owner = THIS_MODULE,},
130} }; 128} };
131 129
132module_phy_driver(cis820x_driver); 130module_phy_driver(cis820x_driver);
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 2a328703b4ae..36e3e2033eca 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -156,7 +156,6 @@ static struct phy_driver dm91xx_driver[] = {
156 .read_status = genphy_read_status, 156 .read_status = genphy_read_status,
157 .ack_interrupt = dm9161_ack_interrupt, 157 .ack_interrupt = dm9161_ack_interrupt,
158 .config_intr = dm9161_config_intr, 158 .config_intr = dm9161_config_intr,
159 .driver = { .owner = THIS_MODULE,},
160}, { 159}, {
161 .phy_id = 0x0181b8b0, 160 .phy_id = 0x0181b8b0,
162 .name = "Davicom DM9161B/C", 161 .name = "Davicom DM9161B/C",
@@ -168,7 +167,6 @@ static struct phy_driver dm91xx_driver[] = {
168 .read_status = genphy_read_status, 167 .read_status = genphy_read_status,
169 .ack_interrupt = dm9161_ack_interrupt, 168 .ack_interrupt = dm9161_ack_interrupt,
170 .config_intr = dm9161_config_intr, 169 .config_intr = dm9161_config_intr,
171 .driver = { .owner = THIS_MODULE,},
172}, { 170}, {
173 .phy_id = 0x0181b8a0, 171 .phy_id = 0x0181b8a0,
174 .name = "Davicom DM9161A", 172 .name = "Davicom DM9161A",
@@ -180,7 +178,6 @@ static struct phy_driver dm91xx_driver[] = {
180 .read_status = genphy_read_status, 178 .read_status = genphy_read_status,
181 .ack_interrupt = dm9161_ack_interrupt, 179 .ack_interrupt = dm9161_ack_interrupt,
182 .config_intr = dm9161_config_intr, 180 .config_intr = dm9161_config_intr,
183 .driver = { .owner = THIS_MODULE,},
184}, { 181}, {
185 .phy_id = 0x00181b80, 182 .phy_id = 0x00181b80,
186 .name = "Davicom DM9131", 183 .name = "Davicom DM9131",
@@ -191,7 +188,6 @@ static struct phy_driver dm91xx_driver[] = {
191 .read_status = genphy_read_status, 188 .read_status = genphy_read_status,
192 .ack_interrupt = dm9161_ack_interrupt, 189 .ack_interrupt = dm9161_ack_interrupt,
193 .config_intr = dm9161_config_intr, 190 .config_intr = dm9161_config_intr,
194 .driver = { .owner = THIS_MODULE,},
195} }; 191} };
196 192
197module_phy_driver(dm91xx_driver); 193module_phy_driver(dm91xx_driver);
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 39da6fc6a85e..180f69952779 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1492,12 +1492,11 @@ static struct phy_driver dp83640_driver = {
1492 .hwtstamp = dp83640_hwtstamp, 1492 .hwtstamp = dp83640_hwtstamp,
1493 .rxtstamp = dp83640_rxtstamp, 1493 .rxtstamp = dp83640_rxtstamp,
1494 .txtstamp = dp83640_txtstamp, 1494 .txtstamp = dp83640_txtstamp,
1495 .driver = {.owner = THIS_MODULE,}
1496}; 1495};
1497 1496
1498static int __init dp83640_init(void) 1497static int __init dp83640_init(void)
1499{ 1498{
1500 return phy_driver_register(&dp83640_driver); 1499 return phy_driver_register(&dp83640_driver, THIS_MODULE);
1501} 1500}
1502 1501
1503static void __exit dp83640_exit(void) 1502static void __exit dp83640_exit(void)
diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c
index 5ce9bef54468..5e14e629c597 100644
--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -88,8 +88,6 @@ static struct phy_driver dp83848_driver[] = {
88 /* IRQ related */ 88 /* IRQ related */
89 .ack_interrupt = dp83848_ack_interrupt, 89 .ack_interrupt = dp83848_ack_interrupt,
90 .config_intr = dp83848_config_intr, 90 .config_intr = dp83848_config_intr,
91
92 .driver = { .owner = THIS_MODULE, },
93 }, 91 },
94}; 92};
95module_phy_driver(dp83848_driver); 93module_phy_driver(dp83848_driver);
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 74e4521bd2d3..2afa61b51d41 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -214,8 +214,6 @@ static struct phy_driver dp83867_driver[] = {
214 .read_status = genphy_read_status, 214 .read_status = genphy_read_status,
215 .suspend = genphy_suspend, 215 .suspend = genphy_suspend,
216 .resume = genphy_resume, 216 .resume = genphy_resume,
217
218 .driver = {.owner = THIS_MODULE,}
219 }, 217 },
220}; 218};
221module_phy_driver(dp83867_driver); 219module_phy_driver(dp83867_driver);
diff --git a/drivers/net/phy/et1011c.c b/drivers/net/phy/et1011c.c
index a907743816a8..a9a4edfa23c8 100644
--- a/drivers/net/phy/et1011c.c
+++ b/drivers/net/phy/et1011c.c
@@ -95,7 +95,6 @@ static struct phy_driver et1011c_driver[] = { {
95 .flags = PHY_POLL, 95 .flags = PHY_POLL,
96 .config_aneg = et1011c_config_aneg, 96 .config_aneg = et1011c_config_aneg,
97 .read_status = et1011c_read_status, 97 .read_status = et1011c_read_status,
98 .driver = { .owner = THIS_MODULE,},
99} }; 98} };
100 99
101module_phy_driver(et1011c_driver); 100module_phy_driver(et1011c_driver);
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index c12170d07b62..e5f251b91578 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -221,7 +221,6 @@ static struct phy_driver icplus_driver[] = {
221 .read_status = &ip175c_read_status, 221 .read_status = &ip175c_read_status,
222 .suspend = genphy_suspend, 222 .suspend = genphy_suspend,
223 .resume = genphy_resume, 223 .resume = genphy_resume,
224 .driver = { .owner = THIS_MODULE,},
225}, { 224}, {
226 .phy_id = 0x02430d90, 225 .phy_id = 0x02430d90,
227 .name = "ICPlus IP1001", 226 .name = "ICPlus IP1001",
@@ -233,7 +232,6 @@ static struct phy_driver icplus_driver[] = {
233 .read_status = &genphy_read_status, 232 .read_status = &genphy_read_status,
234 .suspend = genphy_suspend, 233 .suspend = genphy_suspend,
235 .resume = genphy_resume, 234 .resume = genphy_resume,
236 .driver = { .owner = THIS_MODULE,},
237}, { 235}, {
238 .phy_id = 0x02430c54, 236 .phy_id = 0x02430c54,
239 .name = "ICPlus IP101A/G", 237 .name = "ICPlus IP101A/G",
@@ -247,7 +245,6 @@ static struct phy_driver icplus_driver[] = {
247 .read_status = &genphy_read_status, 245 .read_status = &genphy_read_status,
248 .suspend = genphy_suspend, 246 .suspend = genphy_suspend,
249 .resume = genphy_resume, 247 .resume = genphy_resume,
250 .driver = { .owner = THIS_MODULE,},
251} }; 248} };
252 249
253module_phy_driver(icplus_driver); 250module_phy_driver(icplus_driver);
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index a3a5a703635b..f6078376ef50 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -278,7 +278,6 @@ static struct phy_driver lxt97x_driver[] = {
278 .read_status = genphy_read_status, 278 .read_status = genphy_read_status,
279 .ack_interrupt = lxt970_ack_interrupt, 279 .ack_interrupt = lxt970_ack_interrupt,
280 .config_intr = lxt970_config_intr, 280 .config_intr = lxt970_config_intr,
281 .driver = { .owner = THIS_MODULE,},
282}, { 281}, {
283 .phy_id = 0x001378e0, 282 .phy_id = 0x001378e0,
284 .name = "LXT971", 283 .name = "LXT971",
@@ -289,7 +288,6 @@ static struct phy_driver lxt97x_driver[] = {
289 .read_status = genphy_read_status, 288 .read_status = genphy_read_status,
290 .ack_interrupt = lxt971_ack_interrupt, 289 .ack_interrupt = lxt971_ack_interrupt,
291 .config_intr = lxt971_config_intr, 290 .config_intr = lxt971_config_intr,
292 .driver = { .owner = THIS_MODULE,},
293}, { 291}, {
294 .phy_id = 0x00137a10, 292 .phy_id = 0x00137a10,
295 .name = "LXT973-A2", 293 .name = "LXT973-A2",
@@ -299,7 +297,6 @@ static struct phy_driver lxt97x_driver[] = {
299 .probe = lxt973_probe, 297 .probe = lxt973_probe,
300 .config_aneg = lxt973_config_aneg, 298 .config_aneg = lxt973_config_aneg,
301 .read_status = lxt973a2_read_status, 299 .read_status = lxt973a2_read_status,
302 .driver = { .owner = THIS_MODULE,},
303}, { 300}, {
304 .phy_id = 0x00137a10, 301 .phy_id = 0x00137a10,
305 .name = "LXT973", 302 .name = "LXT973",
@@ -309,7 +306,6 @@ static struct phy_driver lxt97x_driver[] = {
309 .probe = lxt973_probe, 306 .probe = lxt973_probe,
310 .config_aneg = lxt973_config_aneg, 307 .config_aneg = lxt973_config_aneg,
311 .read_status = genphy_read_status, 308 .read_status = genphy_read_status,
312 .driver = { .owner = THIS_MODULE,},
313} }; 309} };
314 310
315module_phy_driver(lxt97x_driver); 311module_phy_driver(lxt97x_driver);
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index f96c93c9819a..e3eb96443c97 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1087,7 +1087,6 @@ static struct phy_driver marvell_drivers[] = {
1087 .get_sset_count = marvell_get_sset_count, 1087 .get_sset_count = marvell_get_sset_count,
1088 .get_strings = marvell_get_strings, 1088 .get_strings = marvell_get_strings,
1089 .get_stats = marvell_get_stats, 1089 .get_stats = marvell_get_stats,
1090 .driver = { .owner = THIS_MODULE },
1091 }, 1090 },
1092 { 1091 {
1093 .phy_id = MARVELL_PHY_ID_88E1112, 1092 .phy_id = MARVELL_PHY_ID_88E1112,
@@ -1106,7 +1105,6 @@ static struct phy_driver marvell_drivers[] = {
1106 .get_sset_count = marvell_get_sset_count, 1105 .get_sset_count = marvell_get_sset_count,
1107 .get_strings = marvell_get_strings, 1106 .get_strings = marvell_get_strings,
1108 .get_stats = marvell_get_stats, 1107 .get_stats = marvell_get_stats,
1109 .driver = { .owner = THIS_MODULE },
1110 }, 1108 },
1111 { 1109 {
1112 .phy_id = MARVELL_PHY_ID_88E1111, 1110 .phy_id = MARVELL_PHY_ID_88E1111,
@@ -1125,7 +1123,6 @@ static struct phy_driver marvell_drivers[] = {
1125 .get_sset_count = marvell_get_sset_count, 1123 .get_sset_count = marvell_get_sset_count,
1126 .get_strings = marvell_get_strings, 1124 .get_strings = marvell_get_strings,
1127 .get_stats = marvell_get_stats, 1125 .get_stats = marvell_get_stats,
1128 .driver = { .owner = THIS_MODULE },
1129 }, 1126 },
1130 { 1127 {
1131 .phy_id = MARVELL_PHY_ID_88E1118, 1128 .phy_id = MARVELL_PHY_ID_88E1118,
@@ -1144,7 +1141,6 @@ static struct phy_driver marvell_drivers[] = {
1144 .get_sset_count = marvell_get_sset_count, 1141 .get_sset_count = marvell_get_sset_count,
1145 .get_strings = marvell_get_strings, 1142 .get_strings = marvell_get_strings,
1146 .get_stats = marvell_get_stats, 1143 .get_stats = marvell_get_stats,
1147 .driver = {.owner = THIS_MODULE,},
1148 }, 1144 },
1149 { 1145 {
1150 .phy_id = MARVELL_PHY_ID_88E1121R, 1146 .phy_id = MARVELL_PHY_ID_88E1121R,
@@ -1163,7 +1159,6 @@ static struct phy_driver marvell_drivers[] = {
1163 .get_sset_count = marvell_get_sset_count, 1159 .get_sset_count = marvell_get_sset_count,
1164 .get_strings = marvell_get_strings, 1160 .get_strings = marvell_get_strings,
1165 .get_stats = marvell_get_stats, 1161 .get_stats = marvell_get_stats,
1166 .driver = { .owner = THIS_MODULE },
1167 }, 1162 },
1168 { 1163 {
1169 .phy_id = MARVELL_PHY_ID_88E1318S, 1164 .phy_id = MARVELL_PHY_ID_88E1318S,
@@ -1184,7 +1179,6 @@ static struct phy_driver marvell_drivers[] = {
1184 .get_sset_count = marvell_get_sset_count, 1179 .get_sset_count = marvell_get_sset_count,
1185 .get_strings = marvell_get_strings, 1180 .get_strings = marvell_get_strings,
1186 .get_stats = marvell_get_stats, 1181 .get_stats = marvell_get_stats,
1187 .driver = { .owner = THIS_MODULE },
1188 }, 1182 },
1189 { 1183 {
1190 .phy_id = MARVELL_PHY_ID_88E1145, 1184 .phy_id = MARVELL_PHY_ID_88E1145,
@@ -1203,7 +1197,6 @@ static struct phy_driver marvell_drivers[] = {
1203 .get_sset_count = marvell_get_sset_count, 1197 .get_sset_count = marvell_get_sset_count,
1204 .get_strings = marvell_get_strings, 1198 .get_strings = marvell_get_strings,
1205 .get_stats = marvell_get_stats, 1199 .get_stats = marvell_get_stats,
1206 .driver = { .owner = THIS_MODULE },
1207 }, 1200 },
1208 { 1201 {
1209 .phy_id = MARVELL_PHY_ID_88E1149R, 1202 .phy_id = MARVELL_PHY_ID_88E1149R,
@@ -1222,7 +1215,6 @@ static struct phy_driver marvell_drivers[] = {
1222 .get_sset_count = marvell_get_sset_count, 1215 .get_sset_count = marvell_get_sset_count,
1223 .get_strings = marvell_get_strings, 1216 .get_strings = marvell_get_strings,
1224 .get_stats = marvell_get_stats, 1217 .get_stats = marvell_get_stats,
1225 .driver = { .owner = THIS_MODULE },
1226 }, 1218 },
1227 { 1219 {
1228 .phy_id = MARVELL_PHY_ID_88E1240, 1220 .phy_id = MARVELL_PHY_ID_88E1240,
@@ -1241,7 +1233,6 @@ static struct phy_driver marvell_drivers[] = {
1241 .get_sset_count = marvell_get_sset_count, 1233 .get_sset_count = marvell_get_sset_count,
1242 .get_strings = marvell_get_strings, 1234 .get_strings = marvell_get_strings,
1243 .get_stats = marvell_get_stats, 1235 .get_stats = marvell_get_stats,
1244 .driver = { .owner = THIS_MODULE },
1245 }, 1236 },
1246 { 1237 {
1247 .phy_id = MARVELL_PHY_ID_88E1116R, 1238 .phy_id = MARVELL_PHY_ID_88E1116R,
@@ -1260,7 +1251,6 @@ static struct phy_driver marvell_drivers[] = {
1260 .get_sset_count = marvell_get_sset_count, 1251 .get_sset_count = marvell_get_sset_count,
1261 .get_strings = marvell_get_strings, 1252 .get_strings = marvell_get_strings,
1262 .get_stats = marvell_get_stats, 1253 .get_stats = marvell_get_stats,
1263 .driver = { .owner = THIS_MODULE },
1264 }, 1254 },
1265 { 1255 {
1266 .phy_id = MARVELL_PHY_ID_88E1510, 1256 .phy_id = MARVELL_PHY_ID_88E1510,
@@ -1279,7 +1269,6 @@ static struct phy_driver marvell_drivers[] = {
1279 .get_sset_count = marvell_get_sset_count, 1269 .get_sset_count = marvell_get_sset_count,
1280 .get_strings = marvell_get_strings, 1270 .get_strings = marvell_get_strings,
1281 .get_stats = marvell_get_stats, 1271 .get_stats = marvell_get_stats,
1282 .driver = { .owner = THIS_MODULE },
1283 }, 1272 },
1284 { 1273 {
1285 .phy_id = MARVELL_PHY_ID_88E1540, 1274 .phy_id = MARVELL_PHY_ID_88E1540,
@@ -1298,7 +1287,6 @@ static struct phy_driver marvell_drivers[] = {
1298 .get_sset_count = marvell_get_sset_count, 1287 .get_sset_count = marvell_get_sset_count,
1299 .get_strings = marvell_get_strings, 1288 .get_strings = marvell_get_strings,
1300 .get_stats = marvell_get_stats, 1289 .get_stats = marvell_get_stats,
1301 .driver = { .owner = THIS_MODULE },
1302 }, 1290 },
1303 { 1291 {
1304 .phy_id = MARVELL_PHY_ID_88E3016, 1292 .phy_id = MARVELL_PHY_ID_88E3016,
@@ -1319,7 +1307,6 @@ static struct phy_driver marvell_drivers[] = {
1319 .get_sset_count = marvell_get_sset_count, 1307 .get_sset_count = marvell_get_sset_count,
1320 .get_strings = marvell_get_strings, 1308 .get_strings = marvell_get_strings,
1321 .get_stats = marvell_get_stats, 1309 .get_stats = marvell_get_stats,
1322 .driver = { .owner = THIS_MODULE },
1323 }, 1310 },
1324}; 1311};
1325 1312
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index b51505be1fa9..0dbc6496b6f6 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -706,7 +706,6 @@ static struct phy_driver ksphy_driver[] = {
706 .get_stats = kszphy_get_stats, 706 .get_stats = kszphy_get_stats,
707 .suspend = genphy_suspend, 707 .suspend = genphy_suspend,
708 .resume = genphy_resume, 708 .resume = genphy_resume,
709 .driver = { .owner = THIS_MODULE,},
710}, { 709}, {
711 .phy_id = PHY_ID_KSZ8021, 710 .phy_id = PHY_ID_KSZ8021,
712 .phy_id_mask = 0x00ffffff, 711 .phy_id_mask = 0x00ffffff,
@@ -726,7 +725,6 @@ static struct phy_driver ksphy_driver[] = {
726 .get_stats = kszphy_get_stats, 725 .get_stats = kszphy_get_stats,
727 .suspend = genphy_suspend, 726 .suspend = genphy_suspend,
728 .resume = genphy_resume, 727 .resume = genphy_resume,
729 .driver = { .owner = THIS_MODULE,},
730}, { 728}, {
731 .phy_id = PHY_ID_KSZ8031, 729 .phy_id = PHY_ID_KSZ8031,
732 .phy_id_mask = 0x00ffffff, 730 .phy_id_mask = 0x00ffffff,
@@ -746,7 +744,6 @@ static struct phy_driver ksphy_driver[] = {
746 .get_stats = kszphy_get_stats, 744 .get_stats = kszphy_get_stats,
747 .suspend = genphy_suspend, 745 .suspend = genphy_suspend,
748 .resume = genphy_resume, 746 .resume = genphy_resume,
749 .driver = { .owner = THIS_MODULE,},
750}, { 747}, {
751 .phy_id = PHY_ID_KSZ8041, 748 .phy_id = PHY_ID_KSZ8041,
752 .phy_id_mask = 0x00fffff0, 749 .phy_id_mask = 0x00fffff0,
@@ -766,7 +763,6 @@ static struct phy_driver ksphy_driver[] = {
766 .get_stats = kszphy_get_stats, 763 .get_stats = kszphy_get_stats,
767 .suspend = genphy_suspend, 764 .suspend = genphy_suspend,
768 .resume = genphy_resume, 765 .resume = genphy_resume,
769 .driver = { .owner = THIS_MODULE,},
770}, { 766}, {
771 .phy_id = PHY_ID_KSZ8041RNLI, 767 .phy_id = PHY_ID_KSZ8041RNLI,
772 .phy_id_mask = 0x00fffff0, 768 .phy_id_mask = 0x00fffff0,
@@ -786,7 +782,6 @@ static struct phy_driver ksphy_driver[] = {
786 .get_stats = kszphy_get_stats, 782 .get_stats = kszphy_get_stats,
787 .suspend = genphy_suspend, 783 .suspend = genphy_suspend,
788 .resume = genphy_resume, 784 .resume = genphy_resume,
789 .driver = { .owner = THIS_MODULE,},
790}, { 785}, {
791 .phy_id = PHY_ID_KSZ8051, 786 .phy_id = PHY_ID_KSZ8051,
792 .phy_id_mask = 0x00fffff0, 787 .phy_id_mask = 0x00fffff0,
@@ -806,7 +801,6 @@ static struct phy_driver ksphy_driver[] = {
806 .get_stats = kszphy_get_stats, 801 .get_stats = kszphy_get_stats,
807 .suspend = genphy_suspend, 802 .suspend = genphy_suspend,
808 .resume = genphy_resume, 803 .resume = genphy_resume,
809 .driver = { .owner = THIS_MODULE,},
810}, { 804}, {
811 .phy_id = PHY_ID_KSZ8001, 805 .phy_id = PHY_ID_KSZ8001,
812 .name = "Micrel KSZ8001 or KS8721", 806 .name = "Micrel KSZ8001 or KS8721",
@@ -825,7 +819,6 @@ static struct phy_driver ksphy_driver[] = {
825 .get_stats = kszphy_get_stats, 819 .get_stats = kszphy_get_stats,
826 .suspend = genphy_suspend, 820 .suspend = genphy_suspend,
827 .resume = genphy_resume, 821 .resume = genphy_resume,
828 .driver = { .owner = THIS_MODULE,},
829}, { 822}, {
830 .phy_id = PHY_ID_KSZ8081, 823 .phy_id = PHY_ID_KSZ8081,
831 .name = "Micrel KSZ8081 or KSZ8091", 824 .name = "Micrel KSZ8081 or KSZ8091",
@@ -844,7 +837,6 @@ static struct phy_driver ksphy_driver[] = {
844 .get_stats = kszphy_get_stats, 837 .get_stats = kszphy_get_stats,
845 .suspend = genphy_suspend, 838 .suspend = genphy_suspend,
846 .resume = genphy_resume, 839 .resume = genphy_resume,
847 .driver = { .owner = THIS_MODULE,},
848}, { 840}, {
849 .phy_id = PHY_ID_KSZ8061, 841 .phy_id = PHY_ID_KSZ8061,
850 .name = "Micrel KSZ8061", 842 .name = "Micrel KSZ8061",
@@ -861,7 +853,6 @@ static struct phy_driver ksphy_driver[] = {
861 .get_stats = kszphy_get_stats, 853 .get_stats = kszphy_get_stats,
862 .suspend = genphy_suspend, 854 .suspend = genphy_suspend,
863 .resume = genphy_resume, 855 .resume = genphy_resume,
864 .driver = { .owner = THIS_MODULE,},
865}, { 856}, {
866 .phy_id = PHY_ID_KSZ9021, 857 .phy_id = PHY_ID_KSZ9021,
867 .phy_id_mask = 0x000ffffe, 858 .phy_id_mask = 0x000ffffe,
@@ -881,7 +872,6 @@ static struct phy_driver ksphy_driver[] = {
881 .resume = genphy_resume, 872 .resume = genphy_resume,
882 .read_mmd_indirect = ksz9021_rd_mmd_phyreg, 873 .read_mmd_indirect = ksz9021_rd_mmd_phyreg,
883 .write_mmd_indirect = ksz9021_wr_mmd_phyreg, 874 .write_mmd_indirect = ksz9021_wr_mmd_phyreg,
884 .driver = { .owner = THIS_MODULE, },
885}, { 875}, {
886 .phy_id = PHY_ID_KSZ9031, 876 .phy_id = PHY_ID_KSZ9031,
887 .phy_id_mask = 0x00fffff0, 877 .phy_id_mask = 0x00fffff0,
@@ -899,7 +889,6 @@ static struct phy_driver ksphy_driver[] = {
899 .get_stats = kszphy_get_stats, 889 .get_stats = kszphy_get_stats,
900 .suspend = genphy_suspend, 890 .suspend = genphy_suspend,
901 .resume = genphy_resume, 891 .resume = genphy_resume,
902 .driver = { .owner = THIS_MODULE, },
903}, { 892}, {
904 .phy_id = PHY_ID_KSZ8873MLL, 893 .phy_id = PHY_ID_KSZ8873MLL,
905 .phy_id_mask = 0x00fffff0, 894 .phy_id_mask = 0x00fffff0,
@@ -914,7 +903,6 @@ static struct phy_driver ksphy_driver[] = {
914 .get_stats = kszphy_get_stats, 903 .get_stats = kszphy_get_stats,
915 .suspend = genphy_suspend, 904 .suspend = genphy_suspend,
916 .resume = genphy_resume, 905 .resume = genphy_resume,
917 .driver = { .owner = THIS_MODULE, },
918}, { 906}, {
919 .phy_id = PHY_ID_KSZ886X, 907 .phy_id = PHY_ID_KSZ886X,
920 .phy_id_mask = 0x00fffff0, 908 .phy_id_mask = 0x00fffff0,
@@ -929,7 +917,6 @@ static struct phy_driver ksphy_driver[] = {
929 .get_stats = kszphy_get_stats, 917 .get_stats = kszphy_get_stats,
930 .suspend = genphy_suspend, 918 .suspend = genphy_suspend,
931 .resume = genphy_resume, 919 .resume = genphy_resume,
932 .driver = { .owner = THIS_MODULE, },
933} }; 920} };
934 921
935module_phy_driver(ksphy_driver); 922module_phy_driver(ksphy_driver);
diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
index 5e34b49be0b3..15f820648f82 100644
--- a/drivers/net/phy/microchip.c
+++ b/drivers/net/phy/microchip.c
@@ -129,8 +129,6 @@ static struct phy_driver microchip_phy_driver[] = {
129 .suspend = lan88xx_suspend, 129 .suspend = lan88xx_suspend,
130 .resume = genphy_resume, 130 .resume = genphy_resume,
131 .set_wol = lan88xx_set_wol, 131 .set_wol = lan88xx_set_wol,
132
133 .driver = { .owner = THIS_MODULE, }
134} }; 132} };
135 133
136module_phy_driver(microchip_phy_driver); 134module_phy_driver(microchip_phy_driver);
diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
index 0a7b9c7f09a2..2a1b490bc587 100644
--- a/drivers/net/phy/national.c
+++ b/drivers/net/phy/national.c
@@ -140,7 +140,6 @@ static struct phy_driver dp83865_driver[] = { {
140 .read_status = genphy_read_status, 140 .read_status = genphy_read_status,
141 .ack_interrupt = ns_ack_interrupt, 141 .ack_interrupt = ns_ack_interrupt,
142 .config_intr = ns_config_intr, 142 .config_intr = ns_config_intr,
143 .driver = {.owner = THIS_MODULE,}
144} }; 143} };
145 144
146module_phy_driver(dp83865_driver); 145module_phy_driver(dp83865_driver);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index eb0b0ed32662..a1b833cd4183 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1564,8 +1564,9 @@ static int phy_remove(struct device *dev)
1564/** 1564/**
1565 * phy_driver_register - register a phy_driver with the PHY layer 1565 * phy_driver_register - register a phy_driver with the PHY layer
1566 * @new_driver: new phy_driver to register 1566 * @new_driver: new phy_driver to register
1567 * @owner: module owning this PHY
1567 */ 1568 */
1568int phy_driver_register(struct phy_driver *new_driver) 1569int phy_driver_register(struct phy_driver *new_driver, struct module *owner)
1569{ 1570{
1570 int retval; 1571 int retval;
1571 1572
@@ -1573,6 +1574,7 @@ int phy_driver_register(struct phy_driver *new_driver)
1573 new_driver->driver.bus = &mdio_bus_type; 1574 new_driver->driver.bus = &mdio_bus_type;
1574 new_driver->driver.probe = phy_probe; 1575 new_driver->driver.probe = phy_probe;
1575 new_driver->driver.remove = phy_remove; 1576 new_driver->driver.remove = phy_remove;
1577 new_driver->driver.owner = owner;
1576 1578
1577 retval = driver_register(&new_driver->driver); 1579 retval = driver_register(&new_driver->driver);
1578 if (retval) { 1580 if (retval) {
@@ -1588,12 +1590,13 @@ int phy_driver_register(struct phy_driver *new_driver)
1588} 1590}
1589EXPORT_SYMBOL(phy_driver_register); 1591EXPORT_SYMBOL(phy_driver_register);
1590 1592
1591int phy_drivers_register(struct phy_driver *new_driver, int n) 1593int phy_drivers_register(struct phy_driver *new_driver, int n,
1594 struct module *owner)
1592{ 1595{
1593 int i, ret = 0; 1596 int i, ret = 0;
1594 1597
1595 for (i = 0; i < n; i++) { 1598 for (i = 0; i < n; i++) {
1596 ret = phy_driver_register(new_driver + i); 1599 ret = phy_driver_register(new_driver + i, owner);
1597 if (ret) { 1600 if (ret) {
1598 while (i-- > 0) 1601 while (i-- > 0)
1599 phy_driver_unregister(new_driver + i); 1602 phy_driver_unregister(new_driver + i);
@@ -1634,7 +1637,6 @@ static struct phy_driver genphy_driver[] = {
1634 .read_status = genphy_read_status, 1637 .read_status = genphy_read_status,
1635 .suspend = genphy_suspend, 1638 .suspend = genphy_suspend,
1636 .resume = genphy_resume, 1639 .resume = genphy_resume,
1637 .driver = { .owner = THIS_MODULE, },
1638}, { 1640}, {
1639 .phy_id = 0xffffffff, 1641 .phy_id = 0xffffffff,
1640 .phy_id_mask = 0xffffffff, 1642 .phy_id_mask = 0xffffffff,
@@ -1646,7 +1648,6 @@ static struct phy_driver genphy_driver[] = {
1646 .read_status = gen10g_read_status, 1648 .read_status = gen10g_read_status,
1647 .suspend = gen10g_suspend, 1649 .suspend = gen10g_suspend,
1648 .resume = gen10g_resume, 1650 .resume = gen10g_resume,
1649 .driver = {.owner = THIS_MODULE, },
1650} }; 1651} };
1651 1652
1652static int __init phy_init(void) 1653static int __init phy_init(void)
@@ -1658,7 +1659,7 @@ static int __init phy_init(void)
1658 return rc; 1659 return rc;
1659 1660
1660 rc = phy_drivers_register(genphy_driver, 1661 rc = phy_drivers_register(genphy_driver,
1661 ARRAY_SIZE(genphy_driver)); 1662 ARRAY_SIZE(genphy_driver), THIS_MODULE);
1662 if (rc) 1663 if (rc)
1663 mdio_bus_exit(); 1664 mdio_bus_exit();
1664 1665
diff --git a/drivers/net/phy/qsemi.c b/drivers/net/phy/qsemi.c
index be4c6f7c3645..d470db89e8dd 100644
--- a/drivers/net/phy/qsemi.c
+++ b/drivers/net/phy/qsemi.c
@@ -122,7 +122,6 @@ static struct phy_driver qs6612_driver[] = { {
122 .read_status = genphy_read_status, 122 .read_status = genphy_read_status,
123 .ack_interrupt = qs6612_ack_interrupt, 123 .ack_interrupt = qs6612_ack_interrupt,
124 .config_intr = qs6612_config_intr, 124 .config_intr = qs6612_config_intr,
125 .driver = { .owner = THIS_MODULE,},
126} }; 125} };
127 126
128module_phy_driver(qs6612_driver); 127module_phy_driver(qs6612_driver);
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 43ab691362d4..aadd6e9f54ad 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -124,7 +124,6 @@ static struct phy_driver realtek_drvs[] = {
124 .flags = PHY_HAS_INTERRUPT, 124 .flags = PHY_HAS_INTERRUPT,
125 .config_aneg = &genphy_config_aneg, 125 .config_aneg = &genphy_config_aneg,
126 .read_status = &genphy_read_status, 126 .read_status = &genphy_read_status,
127 .driver = { .owner = THIS_MODULE,},
128 }, { 127 }, {
129 .phy_id = 0x001cc912, 128 .phy_id = 0x001cc912,
130 .name = "RTL8211B Gigabit Ethernet", 129 .name = "RTL8211B Gigabit Ethernet",
@@ -135,7 +134,6 @@ static struct phy_driver realtek_drvs[] = {
135 .read_status = &genphy_read_status, 134 .read_status = &genphy_read_status,
136 .ack_interrupt = &rtl821x_ack_interrupt, 135 .ack_interrupt = &rtl821x_ack_interrupt,
137 .config_intr = &rtl8211b_config_intr, 136 .config_intr = &rtl8211b_config_intr,
138 .driver = { .owner = THIS_MODULE,},
139 }, { 137 }, {
140 .phy_id = 0x001cc914, 138 .phy_id = 0x001cc914,
141 .name = "RTL8211DN Gigabit Ethernet", 139 .name = "RTL8211DN Gigabit Ethernet",
@@ -148,7 +146,6 @@ static struct phy_driver realtek_drvs[] = {
148 .config_intr = rtl8211e_config_intr, 146 .config_intr = rtl8211e_config_intr,
149 .suspend = genphy_suspend, 147 .suspend = genphy_suspend,
150 .resume = genphy_resume, 148 .resume = genphy_resume,
151 .driver = { .owner = THIS_MODULE,},
152 }, { 149 }, {
153 .phy_id = 0x001cc915, 150 .phy_id = 0x001cc915,
154 .name = "RTL8211E Gigabit Ethernet", 151 .name = "RTL8211E Gigabit Ethernet",
@@ -161,7 +158,6 @@ static struct phy_driver realtek_drvs[] = {
161 .config_intr = &rtl8211e_config_intr, 158 .config_intr = &rtl8211e_config_intr,
162 .suspend = genphy_suspend, 159 .suspend = genphy_suspend,
163 .resume = genphy_resume, 160 .resume = genphy_resume,
164 .driver = { .owner = THIS_MODULE,},
165 }, { 161 }, {
166 .phy_id = 0x001cc916, 162 .phy_id = 0x001cc916,
167 .name = "RTL8211F Gigabit Ethernet", 163 .name = "RTL8211F Gigabit Ethernet",
@@ -175,7 +171,6 @@ static struct phy_driver realtek_drvs[] = {
175 .config_intr = &rtl8211f_config_intr, 171 .config_intr = &rtl8211f_config_intr,
176 .suspend = genphy_suspend, 172 .suspend = genphy_suspend,
177 .resume = genphy_resume, 173 .resume = genphy_resume,
178 .driver = { .owner = THIS_MODULE },
179 }, 174 },
180}; 175};
181 176
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 18c981b95910..ddb06135c21d 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -171,8 +171,6 @@ static struct phy_driver smsc_phy_driver[] = {
171 171
172 .suspend = genphy_suspend, 172 .suspend = genphy_suspend,
173 .resume = genphy_resume, 173 .resume = genphy_resume,
174
175 .driver = { .owner = THIS_MODULE, }
176}, { 174}, {
177 .phy_id = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */ 175 .phy_id = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */
178 .phy_id_mask = 0xfffffff0, 176 .phy_id_mask = 0xfffffff0,
@@ -194,8 +192,6 @@ static struct phy_driver smsc_phy_driver[] = {
194 192
195 .suspend = genphy_suspend, 193 .suspend = genphy_suspend,
196 .resume = genphy_resume, 194 .resume = genphy_resume,
197
198 .driver = { .owner = THIS_MODULE, }
199}, { 195}, {
200 .phy_id = 0x0007c0c0, /* OUI=0x00800f, Model#=0x0c */ 196 .phy_id = 0x0007c0c0, /* OUI=0x00800f, Model#=0x0c */
201 .phy_id_mask = 0xfffffff0, 197 .phy_id_mask = 0xfffffff0,
@@ -217,8 +213,6 @@ static struct phy_driver smsc_phy_driver[] = {
217 213
218 .suspend = genphy_suspend, 214 .suspend = genphy_suspend,
219 .resume = genphy_resume, 215 .resume = genphy_resume,
220
221 .driver = { .owner = THIS_MODULE, }
222}, { 216}, {
223 .phy_id = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */ 217 .phy_id = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
224 .phy_id_mask = 0xfffffff0, 218 .phy_id_mask = 0xfffffff0,
@@ -239,8 +233,6 @@ static struct phy_driver smsc_phy_driver[] = {
239 233
240 .suspend = genphy_suspend, 234 .suspend = genphy_suspend,
241 .resume = genphy_resume, 235 .resume = genphy_resume,
242
243 .driver = { .owner = THIS_MODULE, }
244}, { 236}, {
245 .phy_id = 0x0007c0f0, /* OUI=0x00800f, Model#=0x0f */ 237 .phy_id = 0x0007c0f0, /* OUI=0x00800f, Model#=0x0f */
246 .phy_id_mask = 0xfffffff0, 238 .phy_id_mask = 0xfffffff0,
@@ -262,8 +254,6 @@ static struct phy_driver smsc_phy_driver[] = {
262 254
263 .suspend = genphy_suspend, 255 .suspend = genphy_suspend,
264 .resume = genphy_resume, 256 .resume = genphy_resume,
265
266 .driver = { .owner = THIS_MODULE, }
267} }; 257} };
268 258
269module_phy_driver(smsc_phy_driver); 259module_phy_driver(smsc_phy_driver);
diff --git a/drivers/net/phy/ste10Xp.c b/drivers/net/phy/ste10Xp.c
index 3fc199b773e6..d00cfb64529e 100644
--- a/drivers/net/phy/ste10Xp.c
+++ b/drivers/net/phy/ste10Xp.c
@@ -95,7 +95,6 @@ static struct phy_driver ste10xp_pdriver[] = {
95 .config_intr = ste10Xp_config_intr, 95 .config_intr = ste10Xp_config_intr,
96 .suspend = genphy_suspend, 96 .suspend = genphy_suspend,
97 .resume = genphy_resume, 97 .resume = genphy_resume,
98 .driver = {.owner = THIS_MODULE,}
99}, { 98}, {
100 .phy_id = STE100P_PHY_ID, 99 .phy_id = STE100P_PHY_ID,
101 .phy_id_mask = 0xffffffff, 100 .phy_id_mask = 0xffffffff,
@@ -109,7 +108,6 @@ static struct phy_driver ste10xp_pdriver[] = {
109 .config_intr = ste10Xp_config_intr, 108 .config_intr = ste10Xp_config_intr,
110 .suspend = genphy_suspend, 109 .suspend = genphy_suspend,
111 .resume = genphy_resume, 110 .resume = genphy_resume,
112 .driver = {.owner = THIS_MODULE,}
113} }; 111} };
114 112
115module_phy_driver(ste10xp_pdriver); 113module_phy_driver(ste10xp_pdriver);
diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index 07463fcca212..fb2cef764e9a 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -108,7 +108,6 @@ static struct phy_driver teranetics_driver[] = {
108 .config_aneg = teranetics_config_aneg, 108 .config_aneg = teranetics_config_aneg,
109 .read_status = teranetics_read_status, 109 .read_status = teranetics_read_status,
110 .match_phy_device = teranetics_match_phy_device, 110 .match_phy_device = teranetics_match_phy_device,
111 .driver = { .owner = THIS_MODULE,},
112}, 111},
113}; 112};
114 113
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index dd295dbaa074..2e37eb337d48 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -236,7 +236,6 @@ static struct phy_driver vsc82xx_driver[] = {
236 .read_status = &genphy_read_status, 236 .read_status = &genphy_read_status,
237 .ack_interrupt = &vsc824x_ack_interrupt, 237 .ack_interrupt = &vsc824x_ack_interrupt,
238 .config_intr = &vsc82xx_config_intr, 238 .config_intr = &vsc82xx_config_intr,
239 .driver = { .owner = THIS_MODULE,},
240}, { 239}, {
241 .phy_id = PHY_ID_VSC8244, 240 .phy_id = PHY_ID_VSC8244,
242 .name = "Vitesse VSC8244", 241 .name = "Vitesse VSC8244",
@@ -248,7 +247,6 @@ static struct phy_driver vsc82xx_driver[] = {
248 .read_status = &genphy_read_status, 247 .read_status = &genphy_read_status,
249 .ack_interrupt = &vsc824x_ack_interrupt, 248 .ack_interrupt = &vsc824x_ack_interrupt,
250 .config_intr = &vsc82xx_config_intr, 249 .config_intr = &vsc82xx_config_intr,
251 .driver = { .owner = THIS_MODULE,},
252}, { 250}, {
253 .phy_id = PHY_ID_VSC8514, 251 .phy_id = PHY_ID_VSC8514,
254 .name = "Vitesse VSC8514", 252 .name = "Vitesse VSC8514",
@@ -260,7 +258,6 @@ static struct phy_driver vsc82xx_driver[] = {
260 .read_status = &genphy_read_status, 258 .read_status = &genphy_read_status,
261 .ack_interrupt = &vsc824x_ack_interrupt, 259 .ack_interrupt = &vsc824x_ack_interrupt,
262 .config_intr = &vsc82xx_config_intr, 260 .config_intr = &vsc82xx_config_intr,
263 .driver = { .owner = THIS_MODULE,},
264}, { 261}, {
265 .phy_id = PHY_ID_VSC8574, 262 .phy_id = PHY_ID_VSC8574,
266 .name = "Vitesse VSC8574", 263 .name = "Vitesse VSC8574",
@@ -272,7 +269,6 @@ static struct phy_driver vsc82xx_driver[] = {
272 .read_status = &genphy_read_status, 269 .read_status = &genphy_read_status,
273 .ack_interrupt = &vsc824x_ack_interrupt, 270 .ack_interrupt = &vsc824x_ack_interrupt,
274 .config_intr = &vsc82xx_config_intr, 271 .config_intr = &vsc82xx_config_intr,
275 .driver = { .owner = THIS_MODULE,},
276}, { 272}, {
277 .phy_id = PHY_ID_VSC8601, 273 .phy_id = PHY_ID_VSC8601,
278 .name = "Vitesse VSC8601", 274 .name = "Vitesse VSC8601",
@@ -284,7 +280,6 @@ static struct phy_driver vsc82xx_driver[] = {
284 .read_status = &genphy_read_status, 280 .read_status = &genphy_read_status,
285 .ack_interrupt = &vsc824x_ack_interrupt, 281 .ack_interrupt = &vsc824x_ack_interrupt,
286 .config_intr = &vsc82xx_config_intr, 282 .config_intr = &vsc82xx_config_intr,
287 .driver = { .owner = THIS_MODULE,},
288}, { 283}, {
289 .phy_id = PHY_ID_VSC8662, 284 .phy_id = PHY_ID_VSC8662,
290 .name = "Vitesse VSC8662", 285 .name = "Vitesse VSC8662",
@@ -296,7 +291,6 @@ static struct phy_driver vsc82xx_driver[] = {
296 .read_status = &genphy_read_status, 291 .read_status = &genphy_read_status,
297 .ack_interrupt = &vsc824x_ack_interrupt, 292 .ack_interrupt = &vsc824x_ack_interrupt,
298 .config_intr = &vsc82xx_config_intr, 293 .config_intr = &vsc82xx_config_intr,
299 .driver = { .owner = THIS_MODULE,},
300}, { 294}, {
301 /* Vitesse 8221 */ 295 /* Vitesse 8221 */
302 .phy_id = PHY_ID_VSC8221, 296 .phy_id = PHY_ID_VSC8221,
@@ -309,7 +303,6 @@ static struct phy_driver vsc82xx_driver[] = {
309 .read_status = &genphy_read_status, 303 .read_status = &genphy_read_status,
310 .ack_interrupt = &vsc824x_ack_interrupt, 304 .ack_interrupt = &vsc824x_ack_interrupt,
311 .config_intr = &vsc82xx_config_intr, 305 .config_intr = &vsc82xx_config_intr,
312 .driver = { .owner = THIS_MODULE,},
313}, { 306}, {
314 /* Vitesse 8211 */ 307 /* Vitesse 8211 */
315 .phy_id = PHY_ID_VSC8211, 308 .phy_id = PHY_ID_VSC8211,
@@ -322,7 +315,6 @@ static struct phy_driver vsc82xx_driver[] = {
322 .read_status = &genphy_read_status, 315 .read_status = &genphy_read_status,
323 .ack_interrupt = &vsc824x_ack_interrupt, 316 .ack_interrupt = &vsc824x_ack_interrupt,
324 .config_intr = &vsc82xx_config_intr, 317 .config_intr = &vsc82xx_config_intr,
325 .driver = { .owner = THIS_MODULE,},
326} }; 318} };
327 319
328module_phy_driver(vsc82xx_driver); 320module_phy_driver(vsc82xx_driver);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 2d7beef20825..49e4418822b3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -797,8 +797,9 @@ int genphy_resume(struct phy_device *phydev);
797int genphy_soft_reset(struct phy_device *phydev); 797int genphy_soft_reset(struct phy_device *phydev);
798void phy_driver_unregister(struct phy_driver *drv); 798void phy_driver_unregister(struct phy_driver *drv);
799void phy_drivers_unregister(struct phy_driver *drv, int n); 799void phy_drivers_unregister(struct phy_driver *drv, int n);
800int phy_driver_register(struct phy_driver *new_driver); 800int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
801int phy_drivers_register(struct phy_driver *new_driver, int n); 801int phy_drivers_register(struct phy_driver *new_driver, int n,
802 struct module *owner);
802void phy_state_machine(struct work_struct *work); 803void phy_state_machine(struct work_struct *work);
803void phy_change(struct work_struct *work); 804void phy_change(struct work_struct *work);
804void phy_mac_interrupt(struct phy_device *phydev, int new_link); 805void phy_mac_interrupt(struct phy_device *phydev, int new_link);
@@ -843,7 +844,7 @@ extern struct bus_type mdio_bus_type;
843#define phy_module_driver(__phy_drivers, __count) \ 844#define phy_module_driver(__phy_drivers, __count) \
844static int __init phy_module_init(void) \ 845static int __init phy_module_init(void) \
845{ \ 846{ \
846 return phy_drivers_register(__phy_drivers, __count); \ 847 return phy_drivers_register(__phy_drivers, __count, THIS_MODULE); \
847} \ 848} \
848module_init(phy_module_init); \ 849module_init(phy_module_init); \
849static void __exit phy_module_exit(void) \ 850static void __exit phy_module_exit(void) \