phy: Centralize setting driver module owner
authorAndrew Lunn <andrew@lunn.ch>
Wed, 6 Jan 2016 19:11:22 +0000 (20:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Jan 2016 19:31:27 +0000 (14:31 -0500)
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>
27 files changed:
drivers/net/phy/amd.c
drivers/net/phy/aquantia.c
drivers/net/phy/at803x.c
drivers/net/phy/bcm63xx.c
drivers/net/phy/bcm7xxx.c
drivers/net/phy/bcm87xx.c
drivers/net/phy/broadcom.c
drivers/net/phy/cicada.c
drivers/net/phy/davicom.c
drivers/net/phy/dp83640.c
drivers/net/phy/dp83848.c
drivers/net/phy/dp83867.c
drivers/net/phy/et1011c.c
drivers/net/phy/icplus.c
drivers/net/phy/lxt.c
drivers/net/phy/marvell.c
drivers/net/phy/micrel.c
drivers/net/phy/microchip.c
drivers/net/phy/national.c
drivers/net/phy/phy_device.c
drivers/net/phy/qsemi.c
drivers/net/phy/realtek.c
drivers/net/phy/smsc.c
drivers/net/phy/ste10Xp.c
drivers/net/phy/teranetics.c
drivers/net/phy/vitesse.c
include/linux/phy.h

index 65a488f82eb8c806e703f52abd9295171b6c096c..18141c022b136207a44e28d87dd23255bfb80528 100644 (file)
@@ -72,7 +72,6 @@ static struct phy_driver am79c_driver[] = { {
        .read_status    = genphy_read_status,
        .ack_interrupt  = am79c_ack_interrupt,
        .config_intr    = am79c_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(am79c_driver);
index f1936b7a7af69f1802568b76063e498eb5e54a2b..09b0b0aa8d6877ad233d72c139aa6cd52bcd2db7 100644 (file)
@@ -128,7 +128,6 @@ static struct phy_driver aquantia_driver[] = {
        .config_intr    = aquantia_config_intr,
        .ack_interrupt  = aquantia_ack_interrupt,
        .read_status    = aquantia_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 },
 {
        .phy_id         = PHY_ID_AQ2104,
@@ -141,7 +140,6 @@ static struct phy_driver aquantia_driver[] = {
        .config_intr    = aquantia_config_intr,
        .ack_interrupt  = aquantia_ack_interrupt,
        .read_status    = aquantia_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 },
 {
        .phy_id         = PHY_ID_AQR105,
@@ -154,7 +152,6 @@ static struct phy_driver aquantia_driver[] = {
        .config_intr    = aquantia_config_intr,
        .ack_interrupt  = aquantia_ack_interrupt,
        .read_status    = aquantia_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 },
 {
        .phy_id         = PHY_ID_AQR405,
@@ -167,7 +164,6 @@ static struct phy_driver aquantia_driver[] = {
        .config_intr    = aquantia_config_intr,
        .ack_interrupt  = aquantia_ack_interrupt,
        .read_status    = aquantia_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 },
 };
 
index b76ac09a554f3748249b87c6fb3a9367d470b3c0..8a8f6fb2880d72bbc3c490e6d48e3902cc572315 100644 (file)
@@ -310,9 +310,6 @@ static struct phy_driver at803x_driver[] = {
        .read_status            = genphy_read_status,
        .ack_interrupt          = at803x_ack_interrupt,
        .config_intr            = at803x_config_intr,
-       .driver                 = {
-               .owner = THIS_MODULE,
-       },
 }, {
        /* ATHEROS 8030 */
        .phy_id                 = ATH8030_PHY_ID,
@@ -331,9 +328,6 @@ static struct phy_driver at803x_driver[] = {
        .read_status            = genphy_read_status,
        .ack_interrupt          = at803x_ack_interrupt,
        .config_intr            = at803x_config_intr,
-       .driver                 = {
-               .owner = THIS_MODULE,
-       },
 }, {
        /* ATHEROS 8031 */
        .phy_id                 = ATH8031_PHY_ID,
@@ -352,9 +346,6 @@ static struct phy_driver at803x_driver[] = {
        .read_status            = genphy_read_status,
        .ack_interrupt          = &at803x_ack_interrupt,
        .config_intr            = &at803x_config_intr,
-       .driver                 = {
-               .owner = THIS_MODULE,
-       },
 } };
 
 module_phy_driver(at803x_driver);
index 86b28052bf06e4228674085edbc4eeb599276617..e741bf614c4eeca4f4c041bff53880a5ca8c7439 100644 (file)
@@ -56,7 +56,6 @@ static struct phy_driver bcm63xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        /* same phy as above, with just a different OUI */
        .phy_id         = 0x002bdc00,
@@ -69,7 +68,6 @@ static struct phy_driver bcm63xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 } };
 
 module_phy_driver(bcm63xx_driver);
index 9f4e6eb886af000735c811ca355467138c006fd3..bf241a3ec5e56ceb9d9f85aed73bab90f1559781 100644 (file)
@@ -324,7 +324,6 @@ static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
        .config_aneg    = genphy_config_aneg,                           \
        .read_status    = genphy_read_status,                           \
        .resume         = bcm7xxx_28nm_resume,                          \
-       .driver         = { .owner = THIS_MODULE },                     \
 }
 
 static struct phy_driver bcm7xxx_driver[] = {
@@ -346,7 +345,6 @@ static struct phy_driver bcm7xxx_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = bcm7xxx_suspend,
        .resume         = bcm7xxx_config_init,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM7429,
        .phy_id_mask    = 0xfffffff0,
@@ -359,7 +357,6 @@ static struct phy_driver bcm7xxx_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = bcm7xxx_suspend,
        .resume         = bcm7xxx_config_init,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM7435,
        .phy_id_mask    = 0xfffffff0,
@@ -372,7 +369,6 @@ static struct phy_driver bcm7xxx_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = bcm7xxx_suspend,
        .resume         = bcm7xxx_config_init,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_BCM_OUI_4,
        .phy_id_mask    = 0xffff0000,
@@ -385,7 +381,6 @@ static struct phy_driver bcm7xxx_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = bcm7xxx_suspend,
        .resume         = bcm7xxx_config_init,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_BCM_OUI_5,
        .phy_id_mask    = 0xffffff00,
@@ -398,7 +393,6 @@ static struct phy_driver bcm7xxx_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = bcm7xxx_suspend,
        .resume         = bcm7xxx_config_init,
-       .driver         = { .owner = THIS_MODULE },
 } };
 
 static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
index e536e30d1643d290becfa9d2ee387540adf7cda7..f7ebdcff53e47f8624acaf088b5e49599a4062ea 100644 (file)
@@ -201,7 +201,6 @@ static struct phy_driver bcm87xx_driver[] = {
        .config_intr    = bcm87xx_config_intr,
        .did_interrupt  = bcm87xx_did_interrupt,
        .match_phy_device = bcm8706_match_phy_device,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM8727,
        .phy_id_mask    = 0xffffffff,
@@ -214,7 +213,6 @@ static struct phy_driver bcm87xx_driver[] = {
        .config_intr    = bcm87xx_config_intr,
        .did_interrupt  = bcm87xx_did_interrupt,
        .match_phy_device = bcm8727_match_phy_device,
-       .driver         = { .owner = THIS_MODULE },
 } };
 
 module_phy_driver(bcm87xx_driver);
index 3ce5d9514623ce210ba9f8b13a113b0ef4c91165..870327efccf78ef0db0361212caf0aa899974625 100644 (file)
@@ -460,7 +460,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5421,
        .phy_id_mask    = 0xfffffff0,
@@ -473,7 +472,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5461,
        .phy_id_mask    = 0xfffffff0,
@@ -486,7 +484,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM54616S,
        .phy_id_mask    = 0xfffffff0,
@@ -499,7 +496,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5464,
        .phy_id_mask    = 0xfffffff0,
@@ -512,7 +508,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5481,
        .phy_id_mask    = 0xfffffff0,
@@ -525,7 +520,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5482,
        .phy_id_mask    = 0xfffffff0,
@@ -538,7 +532,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = bcm5482_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM50610,
        .phy_id_mask    = 0xfffffff0,
@@ -551,7 +544,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM50610M,
        .phy_id_mask    = 0xfffffff0,
@@ -564,7 +556,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM57780,
        .phy_id_mask    = 0xfffffff0,
@@ -577,7 +568,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = bcm_phy_ack_intr,
        .config_intr    = bcm_phy_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCMAC131,
        .phy_id_mask    = 0xfffffff0,
@@ -590,7 +580,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = brcm_fet_ack_interrupt,
        .config_intr    = brcm_fet_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 }, {
        .phy_id         = PHY_ID_BCM5241,
        .phy_id_mask    = 0xfffffff0,
@@ -603,7 +592,6 @@ static struct phy_driver broadcom_drivers[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = brcm_fet_ack_interrupt,
        .config_intr    = brcm_fet_config_intr,
-       .driver         = { .owner = THIS_MODULE },
 } };
 
 module_phy_driver(broadcom_drivers);
index 27f5464899d47e2ba9fa21eca7c9d436f14156af..d339c1afea776e664bf19d98c0f5ceebc291c746 100644 (file)
@@ -114,7 +114,6 @@ static struct phy_driver cis820x_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &cis820x_ack_interrupt,
        .config_intr    = &cis820x_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x000fc440,
        .name           = "Cicada Cis8204",
@@ -126,7 +125,6 @@ static struct phy_driver cis820x_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &cis820x_ack_interrupt,
        .config_intr    = &cis820x_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(cis820x_driver);
index 2a328703b4ae175bb4eea0fe1ae4aba332831640..36e3e2033ecab816a3e03edddd47a3232e6961ca 100644 (file)
@@ -156,7 +156,6 @@ static struct phy_driver dm91xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = dm9161_ack_interrupt,
        .config_intr    = dm9161_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x0181b8b0,
        .name           = "Davicom DM9161B/C",
@@ -168,7 +167,6 @@ static struct phy_driver dm91xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = dm9161_ack_interrupt,
        .config_intr    = dm9161_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x0181b8a0,
        .name           = "Davicom DM9161A",
@@ -180,7 +178,6 @@ static struct phy_driver dm91xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = dm9161_ack_interrupt,
        .config_intr    = dm9161_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x00181b80,
        .name           = "Davicom DM9131",
@@ -191,7 +188,6 @@ static struct phy_driver dm91xx_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = dm9161_ack_interrupt,
        .config_intr    = dm9161_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(dm91xx_driver);
index 39da6fc6a85e284a85777c47cadbf783f9e117e5..180f6995277944923b2aa57bacdf0bc17b9637ad 100644 (file)
@@ -1492,12 +1492,11 @@ static struct phy_driver dp83640_driver = {
        .hwtstamp       = dp83640_hwtstamp,
        .rxtstamp       = dp83640_rxtstamp,
        .txtstamp       = dp83640_txtstamp,
-       .driver         = {.owner = THIS_MODULE,}
 };
 
 static int __init dp83640_init(void)
 {
-       return phy_driver_register(&dp83640_driver);
+       return phy_driver_register(&dp83640_driver, THIS_MODULE);
 }
 
 static void __exit dp83640_exit(void)
index 5ce9bef54468aaa1c94fd7cd615f7eb350337efa..5e14e629c5972afcf0bb6ae05e34ad02e549c413 100644 (file)
@@ -88,8 +88,6 @@ static struct phy_driver dp83848_driver[] = {
                /* IRQ related */
                .ack_interrupt  = dp83848_ack_interrupt,
                .config_intr    = dp83848_config_intr,
-
-               .driver         = { .owner = THIS_MODULE, },
        },
 };
 module_phy_driver(dp83848_driver);
index 74e4521bd2d30fa2c285041c88e122b388c8d13e..2afa61b51d411d45bd0b673e6cc93125c2eb9927 100644 (file)
@@ -214,8 +214,6 @@ static struct phy_driver dp83867_driver[] = {
                .read_status    = genphy_read_status,
                .suspend        = genphy_suspend,
                .resume         = genphy_resume,
-
-               .driver         = {.owner = THIS_MODULE,}
        },
 };
 module_phy_driver(dp83867_driver);
index a907743816a84d2b78de3b2778af1f1dc9adcbe9..a9a4edfa23c8cb90ced9495e02d5268acf2b5931 100644 (file)
@@ -95,7 +95,6 @@ static struct phy_driver et1011c_driver[] = { {
        .flags          = PHY_POLL,
        .config_aneg    = et1011c_config_aneg,
        .read_status    = et1011c_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(et1011c_driver);
index c12170d07b62e381791db14e9b0fc9798dbda090..e5f251b915788e87e369027ab0251bb6a9397964 100644 (file)
@@ -221,7 +221,6 @@ static struct phy_driver icplus_driver[] = {
        .read_status    = &ip175c_read_status,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x02430d90,
        .name           = "ICPlus IP1001",
@@ -233,7 +232,6 @@ static struct phy_driver icplus_driver[] = {
        .read_status    = &genphy_read_status,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x02430c54,
        .name           = "ICPlus IP101A/G",
@@ -247,7 +245,6 @@ static struct phy_driver icplus_driver[] = {
        .read_status    = &genphy_read_status,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(icplus_driver);
index a3a5a703635b100703c728a4f19fffa8b33d809b..f6078376ef500f286364e40c0c10bc70ecb3358a 100644 (file)
@@ -278,7 +278,6 @@ static struct phy_driver lxt97x_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = lxt970_ack_interrupt,
        .config_intr    = lxt970_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x001378e0,
        .name           = "LXT971",
@@ -289,7 +288,6 @@ static struct phy_driver lxt97x_driver[] = {
        .read_status    = genphy_read_status,
        .ack_interrupt  = lxt971_ack_interrupt,
        .config_intr    = lxt971_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x00137a10,
        .name           = "LXT973-A2",
@@ -299,7 +297,6 @@ static struct phy_driver lxt97x_driver[] = {
        .probe          = lxt973_probe,
        .config_aneg    = lxt973_config_aneg,
        .read_status    = lxt973a2_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = 0x00137a10,
        .name           = "LXT973",
@@ -309,7 +306,6 @@ static struct phy_driver lxt97x_driver[] = {
        .probe          = lxt973_probe,
        .config_aneg    = lxt973_config_aneg,
        .read_status    = genphy_read_status,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(lxt97x_driver);
index f96c93c9819ae9504b3dff328b025532a4dffa33..e3eb96443c97ad0bc6e03ad0784a119d35b89ee7 100644 (file)
@@ -1087,7 +1087,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1112,
@@ -1106,7 +1105,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1111,
@@ -1125,7 +1123,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1118,
@@ -1144,7 +1141,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = {.owner = THIS_MODULE,},
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1121R,
@@ -1163,7 +1159,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1318S,
@@ -1184,7 +1179,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1145,
@@ -1203,7 +1197,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1149R,
@@ -1222,7 +1215,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1240,
@@ -1241,7 +1233,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1116R,
@@ -1260,7 +1251,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1510,
@@ -1279,7 +1269,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E1540,
@@ -1298,7 +1287,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
        {
                .phy_id = MARVELL_PHY_ID_88E3016,
@@ -1319,7 +1307,6 @@ static struct phy_driver marvell_drivers[] = {
                .get_sset_count = marvell_get_sset_count,
                .get_strings = marvell_get_strings,
                .get_stats = marvell_get_stats,
-               .driver = { .owner = THIS_MODULE },
        },
 };
 
index b51505be1fa9562d99962ace8fa2cef4ebee6d97..0dbc6496b6f6615500f8c2683d5c252bedd9e50b 100644 (file)
@@ -706,7 +706,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8021,
        .phy_id_mask    = 0x00ffffff,
@@ -726,7 +725,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8031,
        .phy_id_mask    = 0x00ffffff,
@@ -746,7 +744,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8041,
        .phy_id_mask    = 0x00fffff0,
@@ -766,7 +763,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8041RNLI,
        .phy_id_mask    = 0x00fffff0,
@@ -786,7 +782,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8051,
        .phy_id_mask    = 0x00fffff0,
@@ -806,7 +801,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8001,
        .name           = "Micrel KSZ8001 or KS8721",
@@ -825,7 +819,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8081,
        .name           = "Micrel KSZ8081 or KSZ8091",
@@ -844,7 +837,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ8061,
        .name           = "Micrel KSZ8061",
@@ -861,7 +853,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_KSZ9021,
        .phy_id_mask    = 0x000ffffe,
@@ -881,7 +872,6 @@ static struct phy_driver ksphy_driver[] = {
        .resume         = genphy_resume,
        .read_mmd_indirect = ksz9021_rd_mmd_phyreg,
        .write_mmd_indirect = ksz9021_wr_mmd_phyreg,
-       .driver         = { .owner = THIS_MODULE, },
 }, {
        .phy_id         = PHY_ID_KSZ9031,
        .phy_id_mask    = 0x00fffff0,
@@ -899,7 +889,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE, },
 }, {
        .phy_id         = PHY_ID_KSZ8873MLL,
        .phy_id_mask    = 0x00fffff0,
@@ -914,7 +903,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE, },
 }, {
        .phy_id         = PHY_ID_KSZ886X,
        .phy_id_mask    = 0x00fffff0,
@@ -929,7 +917,6 @@ static struct phy_driver ksphy_driver[] = {
        .get_stats      = kszphy_get_stats,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE, },
 } };
 
 module_phy_driver(ksphy_driver);
index 5e34b49be0b364b747a1a5bf487ba007065604dc..15f820648f826eb5f301d48078d5eb8a25d60536 100644 (file)
@@ -129,8 +129,6 @@ static struct phy_driver microchip_phy_driver[] = {
        .suspend        = lan88xx_suspend,
        .resume         = genphy_resume,
        .set_wol        = lan88xx_set_wol,
-
-       .driver         = { .owner = THIS_MODULE, }
 } };
 
 module_phy_driver(microchip_phy_driver);
index 0a7b9c7f09a299d51f1388cdd3342e8e7fe120ad..2a1b490bc58718ee20e647ec341aa54707bf174a 100644 (file)
@@ -140,7 +140,6 @@ static struct phy_driver dp83865_driver[] = { {
        .read_status = genphy_read_status,
        .ack_interrupt = ns_ack_interrupt,
        .config_intr = ns_config_intr,
-       .driver = {.owner = THIS_MODULE,}
 } };
 
 module_phy_driver(dp83865_driver);
index eb0b0ed32662be35e376ab5250d72bd48d030d80..a1b833cd4183d5b8780fcec9ab658f57cfdca4f7 100644 (file)
@@ -1564,8 +1564,9 @@ static int phy_remove(struct device *dev)
 /**
  * phy_driver_register - register a phy_driver with the PHY layer
  * @new_driver: new phy_driver to register
+ * @owner: module owning this PHY
  */
-int phy_driver_register(struct phy_driver *new_driver)
+int phy_driver_register(struct phy_driver *new_driver, struct module *owner)
 {
        int retval;
 
@@ -1573,6 +1574,7 @@ int phy_driver_register(struct phy_driver *new_driver)
        new_driver->driver.bus = &mdio_bus_type;
        new_driver->driver.probe = phy_probe;
        new_driver->driver.remove = phy_remove;
+       new_driver->driver.owner = owner;
 
        retval = driver_register(&new_driver->driver);
        if (retval) {
@@ -1588,12 +1590,13 @@ int phy_driver_register(struct phy_driver *new_driver)
 }
 EXPORT_SYMBOL(phy_driver_register);
 
-int phy_drivers_register(struct phy_driver *new_driver, int n)
+int phy_drivers_register(struct phy_driver *new_driver, int n,
+                        struct module *owner)
 {
        int i, ret = 0;
 
        for (i = 0; i < n; i++) {
-               ret = phy_driver_register(new_driver + i);
+               ret = phy_driver_register(new_driver + i, owner);
                if (ret) {
                        while (i-- > 0)
                                phy_driver_unregister(new_driver + i);
@@ -1634,7 +1637,6 @@ static struct phy_driver genphy_driver[] = {
        .read_status    = genphy_read_status,
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-       .driver         = { .owner = THIS_MODULE, },
 }, {
        .phy_id         = 0xffffffff,
        .phy_id_mask    = 0xffffffff,
@@ -1646,7 +1648,6 @@ static struct phy_driver genphy_driver[] = {
        .read_status    = gen10g_read_status,
        .suspend        = gen10g_suspend,
        .resume         = gen10g_resume,
-       .driver         = {.owner = THIS_MODULE, },
 } };
 
 static int __init phy_init(void)
@@ -1658,7 +1659,7 @@ static int __init phy_init(void)
                return rc;
 
        rc = phy_drivers_register(genphy_driver,
-                                 ARRAY_SIZE(genphy_driver));
+                                 ARRAY_SIZE(genphy_driver), THIS_MODULE);
        if (rc)
                mdio_bus_exit();
 
index be4c6f7c3645fc69c4d7d2bce02366d23e17eaf1..d470db89e8dde1d32973a07dea84dd6dbbe05941 100644 (file)
@@ -122,7 +122,6 @@ static struct phy_driver qs6612_driver[] = { {
        .read_status    = genphy_read_status,
        .ack_interrupt  = qs6612_ack_interrupt,
        .config_intr    = qs6612_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(qs6612_driver);
index 43ab691362d48a982a571288f81269473429edae..aadd6e9f54adc5b2bb9947dd8ad4ac2f5fffda5f 100644 (file)
@@ -124,7 +124,6 @@ static struct phy_driver realtek_drvs[] = {
                .flags          = PHY_HAS_INTERRUPT,
                .config_aneg    = &genphy_config_aneg,
                .read_status    = &genphy_read_status,
-               .driver         = { .owner = THIS_MODULE,},
        }, {
                .phy_id         = 0x001cc912,
                .name           = "RTL8211B Gigabit Ethernet",
@@ -135,7 +134,6 @@ static struct phy_driver realtek_drvs[] = {
                .read_status    = &genphy_read_status,
                .ack_interrupt  = &rtl821x_ack_interrupt,
                .config_intr    = &rtl8211b_config_intr,
-               .driver         = { .owner = THIS_MODULE,},
        }, {
                .phy_id         = 0x001cc914,
                .name           = "RTL8211DN Gigabit Ethernet",
@@ -148,7 +146,6 @@ static struct phy_driver realtek_drvs[] = {
                .config_intr    = rtl8211e_config_intr,
                .suspend        = genphy_suspend,
                .resume         = genphy_resume,
-               .driver         = { .owner = THIS_MODULE,},
        }, {
                .phy_id         = 0x001cc915,
                .name           = "RTL8211E Gigabit Ethernet",
@@ -161,7 +158,6 @@ static struct phy_driver realtek_drvs[] = {
                .config_intr    = &rtl8211e_config_intr,
                .suspend        = genphy_suspend,
                .resume         = genphy_resume,
-               .driver         = { .owner = THIS_MODULE,},
        }, {
                .phy_id         = 0x001cc916,
                .name           = "RTL8211F Gigabit Ethernet",
@@ -175,7 +171,6 @@ static struct phy_driver realtek_drvs[] = {
                .config_intr    = &rtl8211f_config_intr,
                .suspend        = genphy_suspend,
                .resume         = genphy_resume,
-               .driver         = { .owner = THIS_MODULE },
        },
 };
 
index 18c981b95910003008eb4e14e436d478b07d67d8..ddb06135c21dfcb4d8d52465a50f7471b0ce2326 100644 (file)
@@ -171,8 +171,6 @@ static struct phy_driver smsc_phy_driver[] = {
 
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-
-       .driver         = { .owner = THIS_MODULE, }
 }, {
        .phy_id         = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */
        .phy_id_mask    = 0xfffffff0,
@@ -194,8 +192,6 @@ static struct phy_driver smsc_phy_driver[] = {
 
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-
-       .driver         = { .owner = THIS_MODULE, }
 }, {
        .phy_id         = 0x0007c0c0, /* OUI=0x00800f, Model#=0x0c */
        .phy_id_mask    = 0xfffffff0,
@@ -217,8 +213,6 @@ static struct phy_driver smsc_phy_driver[] = {
 
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-
-       .driver         = { .owner = THIS_MODULE, }
 }, {
        .phy_id         = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
        .phy_id_mask    = 0xfffffff0,
@@ -239,8 +233,6 @@ static struct phy_driver smsc_phy_driver[] = {
 
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-
-       .driver         = { .owner = THIS_MODULE, }
 }, {
        .phy_id         = 0x0007c0f0, /* OUI=0x00800f, Model#=0x0f */
        .phy_id_mask    = 0xfffffff0,
@@ -262,8 +254,6 @@ static struct phy_driver smsc_phy_driver[] = {
 
        .suspend        = genphy_suspend,
        .resume         = genphy_resume,
-
-       .driver         = { .owner = THIS_MODULE, }
 } };
 
 module_phy_driver(smsc_phy_driver);
index 3fc199b773e633badeb2aa4b1b1a70877280b4cf..d00cfb64529e65493b6a18b51785500f6bc63aa0 100644 (file)
@@ -95,7 +95,6 @@ static struct phy_driver ste10xp_pdriver[] = {
        .config_intr = ste10Xp_config_intr,
        .suspend = genphy_suspend,
        .resume = genphy_resume,
-       .driver = {.owner = THIS_MODULE,}
 }, {
        .phy_id = STE100P_PHY_ID,
        .phy_id_mask = 0xffffffff,
@@ -109,7 +108,6 @@ static struct phy_driver ste10xp_pdriver[] = {
        .config_intr = ste10Xp_config_intr,
        .suspend = genphy_suspend,
        .resume = genphy_resume,
-       .driver = {.owner = THIS_MODULE,}
 } };
 
 module_phy_driver(ste10xp_pdriver);
index 07463fcca2126fd8838bf0fefee228dd11fd31d6..fb2cef764e9ab56416ba2f2d85ddd75af08a01ed 100644 (file)
@@ -108,7 +108,6 @@ static struct phy_driver teranetics_driver[] = {
        .config_aneg    = teranetics_config_aneg,
        .read_status    = teranetics_read_status,
        .match_phy_device = teranetics_match_phy_device,
-       .driver         = { .owner = THIS_MODULE,},
 },
 };
 
index dd295dbaa074642a7115b65123d06920744c7f88..2e37eb337d4868715606b92dab65cfeb60a37679 100644 (file)
@@ -236,7 +236,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_VSC8244,
        .name           = "Vitesse VSC8244",
@@ -248,7 +247,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_VSC8514,
        .name           = "Vitesse VSC8514",
@@ -260,7 +258,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_VSC8574,
        .name           = "Vitesse VSC8574",
@@ -272,7 +269,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_VSC8601,
        .name           = "Vitesse VSC8601",
@@ -284,7 +280,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        .phy_id         = PHY_ID_VSC8662,
        .name           = "Vitesse VSC8662",
@@ -296,7 +291,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        /* Vitesse 8221 */
        .phy_id         = PHY_ID_VSC8221,
@@ -309,7 +303,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 }, {
        /* Vitesse 8211 */
        .phy_id         = PHY_ID_VSC8211,
@@ -322,7 +315,6 @@ static struct phy_driver vsc82xx_driver[] = {
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
        .config_intr    = &vsc82xx_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
 } };
 
 module_phy_driver(vsc82xx_driver);
index 2d7beef208258b64b0434dfac24b90d94521544e..49e4418822b3070b1d43d14b41eb4cee763d8c53 100644 (file)
@@ -797,8 +797,9 @@ int genphy_resume(struct phy_device *phydev);
 int genphy_soft_reset(struct phy_device *phydev);
 void phy_driver_unregister(struct phy_driver *drv);
 void phy_drivers_unregister(struct phy_driver *drv, int n);
-int phy_driver_register(struct phy_driver *new_driver);
-int phy_drivers_register(struct phy_driver *new_driver, int n);
+int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
+int phy_drivers_register(struct phy_driver *new_driver, int n,
+                        struct module *owner);
 void phy_state_machine(struct work_struct *work);
 void phy_change(struct work_struct *work);
 void phy_mac_interrupt(struct phy_device *phydev, int new_link);
@@ -843,7 +844,7 @@ extern struct bus_type mdio_bus_type;
 #define phy_module_driver(__phy_drivers, __count)                      \
 static int __init phy_module_init(void)                                        \
 {                                                                      \
-       return phy_drivers_register(__phy_drivers, __count);            \
+       return phy_drivers_register(__phy_drivers, __count, THIS_MODULE); \
 }                                                                      \
 module_init(phy_module_init);                                          \
 static void __exit phy_module_exit(void)                               \