diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-08-12 23:50:30 +0200 |
---|---|---|
committer | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-08-13 17:14:06 -0700 |
commit | 7b261e0ef5f88087765df7f079a4bd0d285f7579 (patch) | |
tree | 056d0dafb6953f1b2aaf8c2fc6a1861ab7d3f815 /drivers/net/phy | |
parent | 043b8413e8c0c0ffbf8be268eb73716e05a96064 (diff) | |
download | lwn-7b261e0ef5f88087765df7f079a4bd0d285f7579.tar.gz lwn-7b261e0ef5f88087765df7f079a4bd0d285f7579.zip |
net: phy: add __set_linkmode_max_speed
We will need the functionality of __set_linkmode_max_speed also for
linkmode bitmaps other than phydev->supported. Therefore split it.
v2:
- remove unused parameter from __set_linkmode_max_speed
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy-core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 9ae3abb2daca..95f1e85d0d87 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -207,14 +207,14 @@ size_t phy_speeds(unsigned int *speeds, size_t size, return count; } -static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) +static int __set_linkmode_max_speed(u32 max_speed, unsigned long *addr) { const struct phy_setting *p; int i; for (i = 0, p = settings; i < ARRAY_SIZE(settings); i++, p++) { if (p->speed > max_speed) - linkmode_clear_bit(p->bit, phydev->supported); + linkmode_clear_bit(p->bit, addr); else break; } @@ -222,6 +222,11 @@ static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) return 0; } +static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) +{ + return __set_linkmode_max_speed(max_speed, phydev->supported); +} + int phy_set_max_speed(struct phy_device *phydev, u32 max_speed) { int err; |