Skip to content

Commit 7d82737

Browse files
committed
Merge branch 'net-phy-clean-up-the-old-gen10g-functions'
Heiner Kallweit says: ==================== net: phy: clean up the old gen10g functions The old gen10g_ functions are mainly stubs and have been superseded by genphy_c45_ equivalents. So lets remove / hide the old functions as far as possible. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 6bfc112 + 7be3ad8 commit 7d82737

File tree

6 files changed

+10
-57
lines changed

6 files changed

+10
-57
lines changed

drivers/net/phy/cortina.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ static struct phy_driver cortina_driver[] = {
8080
.phy_id_mask = 0xffffffff,
8181
.name = "Cortina CS4340",
8282
.features = PHY_10GBIT_FEATURES,
83-
.config_init = gen10g_config_init,
8483
.config_aneg = gen10g_config_aneg,
8584
.read_status = cortina_read_status,
86-
.soft_reset = gen10g_no_soft_reset,
85+
.soft_reset = genphy_no_soft_reset,
8786
.probe = cortina_probe,
8887
},
8988
};

drivers/net/phy/marvell10g.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static struct phy_driver mv3310_drivers[] = {
459459
.phy_id_mask = MARVELL_PHY_ID_MASK,
460460
.name = "mv88x3310",
461461
.get_features = mv3310_get_features,
462-
.soft_reset = gen10g_no_soft_reset,
462+
.soft_reset = genphy_no_soft_reset,
463463
.config_init = mv3310_config_init,
464464
.probe = mv3310_probe,
465465
.suspend = mv3310_suspend,
@@ -474,7 +474,7 @@ static struct phy_driver mv3310_drivers[] = {
474474
.name = "mv88x2110",
475475
.get_features = genphy_c45_pma_read_abilities,
476476
.probe = mv3310_probe,
477-
.soft_reset = gen10g_no_soft_reset,
477+
.soft_reset = genphy_no_soft_reset,
478478
.config_init = mv3310_config_init,
479479
.config_aneg = mv3310_config_aneg,
480480
.aneg_done = mv3310_aneg_done,

drivers/net/phy/phy-c45.c

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -499,57 +499,21 @@ int gen10g_config_aneg(struct phy_device *phydev)
499499
}
500500
EXPORT_SYMBOL_GPL(gen10g_config_aneg);
501501

502-
int gen10g_read_status(struct phy_device *phydev)
502+
static int gen10g_read_status(struct phy_device *phydev)
503503
{
504504
/* For now just lie and say it's 10G all the time */
505505
phydev->speed = SPEED_10000;
506506
phydev->duplex = DUPLEX_FULL;
507507

508508
return genphy_c45_read_link(phydev);
509509
}
510-
EXPORT_SYMBOL_GPL(gen10g_read_status);
511-
512-
int gen10g_no_soft_reset(struct phy_device *phydev)
513-
{
514-
/* Do nothing for now */
515-
return 0;
516-
}
517-
EXPORT_SYMBOL_GPL(gen10g_no_soft_reset);
518-
519-
int gen10g_config_init(struct phy_device *phydev)
520-
{
521-
/* Temporarily just say we support everything */
522-
linkmode_zero(phydev->supported);
523-
524-
linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
525-
phydev->supported);
526-
linkmode_copy(phydev->advertising, phydev->supported);
527-
528-
return 0;
529-
}
530-
EXPORT_SYMBOL_GPL(gen10g_config_init);
531-
532-
int gen10g_suspend(struct phy_device *phydev)
533-
{
534-
return 0;
535-
}
536-
EXPORT_SYMBOL_GPL(gen10g_suspend);
537-
538-
int gen10g_resume(struct phy_device *phydev)
539-
{
540-
return 0;
541-
}
542-
EXPORT_SYMBOL_GPL(gen10g_resume);
543510

544511
struct phy_driver genphy_10g_driver = {
545512
.phy_id = 0xffffffff,
546513
.phy_id_mask = 0xffffffff,
547514
.name = "Generic 10G PHY",
548-
.soft_reset = gen10g_no_soft_reset,
549-
.config_init = gen10g_config_init,
515+
.soft_reset = genphy_no_soft_reset,
550516
.features = PHY_10GBIT_FEATURES,
551517
.config_aneg = gen10g_config_aneg,
552518
.read_status = gen10g_read_status,
553-
.suspend = gen10g_suspend,
554-
.resume = gen10g_resume,
555519
};

drivers/net/phy/phy.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,10 @@ int phy_aneg_done(struct phy_device *phydev)
144144
{
145145
if (phydev->drv && phydev->drv->aneg_done)
146146
return phydev->drv->aneg_done(phydev);
147-
148-
/* Avoid genphy_aneg_done() if the Clause 45 PHY does not
149-
* implement Clause 22 registers
150-
*/
151-
if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
152-
return -EINVAL;
153-
154-
return genphy_aneg_done(phydev);
147+
else if (phydev->is_c45)
148+
return genphy_c45_aneg_done(phydev);
149+
else
150+
return genphy_aneg_done(phydev);
155151
}
156152
EXPORT_SYMBOL(phy_aneg_done);
157153

drivers/net/phy/teranetics.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ static struct phy_driver teranetics_driver[] = {
7878
.phy_id_mask = 0xffffffff,
7979
.name = "Teranetics TN2020",
8080
.features = PHY_10GBIT_FEATURES,
81-
.soft_reset = gen10g_no_soft_reset,
81+
.soft_reset = genphy_no_soft_reset,
8282
.aneg_done = teranetics_aneg_done,
83-
.config_init = gen10g_config_init,
8483
.config_aneg = gen10g_config_aneg,
8584
.read_status = teranetics_read_status,
8685
.match_phy_device = teranetics_match_phy_device,

include/linux/phy.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,11 +1119,6 @@ int genphy_c45_read_status(struct phy_device *phydev);
11191119

11201120
/* The gen10g_* functions are the old Clause 45 stub */
11211121
int gen10g_config_aneg(struct phy_device *phydev);
1122-
int gen10g_read_status(struct phy_device *phydev);
1123-
int gen10g_no_soft_reset(struct phy_device *phydev);
1124-
int gen10g_config_init(struct phy_device *phydev);
1125-
int gen10g_suspend(struct phy_device *phydev);
1126-
int gen10g_resume(struct phy_device *phydev);
11271122

11281123
static inline int phy_read_status(struct phy_device *phydev)
11291124
{

0 commit comments

Comments
 (0)