net: phy: remove genphy_config_eee_advert
Subsystems (4)
Heiner Kallweit
maintainercover net: phy: remove genphy_config_eee_advert
This series removes genphy_config_eee_advert().
Note: The change to bcm_config_lre_aneg() is compile-tested only as I don't have supported hardware.
Heiner Kallweit (4):
net: phy: make genphy_c45_write_eee_adv() static
net: phy: export genphy_c45_an_config_eee_aneg
net: phy: broadcom: use genphy_c45_an_config_eee_aneg in
bcm_config_lre_aneg
net: phy: remove genphy_config_eee_advert
drivers/net/phy/bcm-phy-lib.c | 2 +- drivers/net/phy/phy-c45.c | 4 +++- drivers/net/phy/phy_device.c | 23 ----------------------- include/linux/phy.h | 2 -- 4 files changed, 4 insertions(+), 27 deletions(-)
Signature · 1 line
2.47.0
Heiner Kallweit
maintainerPATCH 1/4 net: phy: make genphy_c45_write_eee_adv() static
genphy_c45_write_eee_adv() isn't used outside phy-c45.c, so make it static.
--- drivers/net/phy/phy-c45.c | 3 ++- include/linux/phy.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/phy-c45.c +2 -1
@@ -680,7 +680,8 @@ EXPORT_SYMBOL_GPL(genphy_c45_read_mdix);* @phydev: target phy_device struct * @adv: the linkmode advertisement settings */ -int genphy_c45_write_eee_adv (struct phy_device *phydev,unsigned long *adv) +static int genphy_c45_write_eee_adv (struct phy_device *phydev, +unsigned long *adv) {int val, changed =0 ;
include/linux/phy.h +0 -1
@@ -1954,7 +1954,6 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev, struct ethtool_keee *data);int genphy_c45_ethtool_set_eee (struct phy_device *phydev,struct ethtool_keee *data); -int genphy_c45_write_eee_adv (struct phy_device *phydev,unsigned long *adv);int genphy_c45_an_config_eee_aneg (struct phy_device *phydev);int genphy_c45_read_eee_adv (struct phy_device *phydev,unsigned long *adv);
Signature · 1 line
2.47.0
Re: [PATCH net-next 1/4] net: phy: make genphy_c45_write_eee_adv() static
On Wed, Nov 06, 2024 at 09:19:59PM +0100, Heiner Kallweit wrote:
61;7801;1c> genphy_c45_write_eee_adv() isn't used outside phy-c45.c,
Quoted 3 lines
so make it static.
Signed-off-by Heiner Kallweit <[email protected]>
Andrew
Re: [PATCH net-next 1/4] net: phy: make genphy_c45_write_eee_adv() static
In reply to Heiner KallweitQuoted 4 lines · Heiner Kallweit
genphy_c45_write_eee_adv()isn't used outsidephy-c45.c, so make it static.Signed-off-by Heiner Kallweit <[email protected]>
Signature · 1 line
Florian
Heiner Kallweit
maintainerPATCH 2/4 net: phy: export genphy_c45_an_config_eee_aneg
In reply to Heiner KallweitWe'll use this function in bcm_config_lre_aneg(), therefore export it.
--- drivers/net/phy/phy-c45.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/phy/phy-c45.c +1 -0
@@ -951,6 +951,7 @@ int genphy_c45_an_config_eee_aneg(struct phy_device *phydev)return genphy_c45_write_eee_adv (phydev, phydev->advertising_eee); } +EXPORT_SYMBOL_GPL (genphy_c45_an_config_eee_aneg);/** * genphy_c45_pma_baset1_read_abilities - read supported baset1 link modes from PMA
Signature · 1 line
2.47.0
Re: [PATCH net-next 2/4] net: phy: export genphy_c45_an_config_eee_aneg
Quoted 3 lines · Heiner Kallweit
We'll use this function in
bcm_config_lre_aneg(), therefore export it.Signed-off-by Heiner Kallweit <[email protected]>
Signature · 1 line
Florian
Heiner Kallweit
maintainerPATCH 3/4 net: phy: broadcom: use genphy_c45_an_config_eee_aneg in bcm_config_lre_aneg
In reply to Heiner Kallweitbcm_config_lre_aneg() is the only user of genphy_config_eee_advert(), therefore use genphy_c45_an_config_eee_aneg() instead. The resulting functionality is equivalent, and bcm_config_lre_aneg() follows the structure of __genphy_config_aneg().
In a follow-up step genphy_config_eee_advert() can be removed.
Note: We preserve the current behavior to ignore errors.
--- drivers/net/phy/bcm-phy-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/bcm-phy-lib.c +1 -1
@@ -1137,7 +1137,7 @@ int bcm_config_lre_aneg(struct phy_device *phydev, bool changed) {int err; -if (genphy_config_eee_advert (phydev)) +if (genphy_c45_an_config_eee_aneg (phydev) >0 ) changed = true; err =bcm_setup_lre_master_slave (phydev);
Signature · 1 line
2.47.0
Re: [PATCH net-next 3/4] net: phy: broadcom: use genphy_c45_an_config_eee_aneg in bcm_config_lre_aneg
Quoted 4 lines · Heiner Kallweit
bcm_config_lre_aneg()is the only user ofgenphy_config_eee_advert(), therefore usegenphy_c45_an_config_eee_aneg()instead. The resulting functionality is equivalent, andbcm_config_lre_aneg()follows the structure of__genphy_config_aneg().
I think the commit message could be clearer. Just looking at genphy_config_eee_advert() and genphy_c45_an_config_eee_aneg() it is not clear they are equivalent. You need to dig into genphy_c45_write_eee_adv() where phydev->eee_broken_modes comes in, and they start to look similar.
It does however look like this will work, so:
Andrew
Re: [PATCH net-next 3/4] net: phy: broadcom: use genphy_c45_an_config_eee_aneg in bcm_config_lre_aneg
In reply to Heiner KallweitQuoted 9 lines · Heiner Kallweit
bcm_config_lre_aneg()is the only user ofgenphy_config_eee_advert(), therefore usegenphy_c45_an_config_eee_aneg()instead. The resulting functionality is equivalent, andbcm_config_lre_aneg()follows the structure of__genphy_config_aneg().
In a follow-up stepgenphy_config_eee_advert()can be removed.Note: We preserve the current behavior to ignore errors.
Signed-off-by Heiner Kallweit <[email protected]>
Thanks, this also makes the driver future proof with respect to 2.5/5G modes which was not the case before.
Signature · 1 line
Florian
Heiner Kallweit
maintainerPATCH 4/4 net: phy: remove genphy_config_eee_advert
In reply to Heiner Kallweitbcm_config_lre_aneg() doesn't use genphy_config_eee_advert() any longer. As this was the only user, we can remove genphy_config_eee_advert() now.
--- drivers/net/phy/phy_device.c | 23 ----------------------- include/linux/phy.h | 1 - 2 files changed, 24 deletions(-)
drivers/net/phy/phy_device.c +0 -23
@@ -2239,29 +2239,6 @@ static int genphy_c37_config_advert(struct phy_device *phydev) adv); } -/** -* genphy_config_eee_advert - disable unwanted eee mode advertisement -* @phydev: target phy_device struct -* -* Description: Writes MDIO_AN_EEE_ADV after disabling unsupported energy -* efficent ethernet modes. Returns 0 if the PHY's advertisement hasn't -* changed, and 1 if it has changed. -*/ -int genphy_config_eee_advert (struct phy_device *phydev) -{ -int err; - -/* Nothing to disable */ -if (!phydev->eee_broken_modes) -return 0 ; - - err =phy_modify_mmd_changed (phydev,MDIO_MMD_AN ,MDIO_AN_EEE_ADV , - phydev->eee_broken_modes,0 ); -/* If the call failed, we assume that EEE is not supported */ -return err <0 ?0 : err; -} -EXPORT_SYMBOL (genphy_config_eee_advert); -/** * genphy_setup_forced - configures/forces speed/duplex from @phydev * @phydev: target phy_device struct
include/linux/phy.h +0 -1
@@ -1886,7 +1886,6 @@ int genphy_read_abilities(struct phy_device *phydev);int genphy_setup_forced (struct phy_device *phydev);int genphy_restart_aneg (struct phy_device *phydev);int genphy_check_and_restart_aneg (struct phy_device *phydev,bool restart); -int genphy_config_eee_advert (struct phy_device *phydev);int __genphy_config_aneg (struct phy_device *phydev,bool changed);int genphy_aneg_done (struct phy_device *phydev);int genphy_update_link (struct phy_device *phydev);
Signature · 1 line
2.47.0
Quoted 2 lines · Heiner Kallweit
bcm_config_lre_aneg()doesn't usegenphy_config_eee_advert()any longer. As this was the only user, we can removegenphy_config_eee_advert()now.
The naming of genphy_config_eee_advert() is also quiet bad, so it is good to see it go for that reason.
Andrew
Quoted 4 lines · Heiner Kallweit
bcm_config_lre_aneg()doesn't usegenphy_config_eee_advert()any longer. As this was the only user, we can removegenphy_config_eee_advert()now.Signed-off-by Heiner Kallweit <[email protected]>
Signature · 1 line
Florian
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 5 lines · On Wed, 6 Nov 2024 21:19:02 +0100 you wrote:
This series removes
genphy_config_eee_advert().Note: The change to
bcm_config_lre_aneg()is compile-tested only as I don't have supported hardware.
Quoted 8 lines
Heiner Kallweit (4):
net: phy: makegenphy_c45_write_eee_adv()static
net: phy: exportgenphy_c45_an_config_eee_aneg
net: phy: broadcom: usegenphy_c45_an_config_eee_anegin
bcm_config_lre_aneg
net: phy: removegenphy_config_eee_advert[...]
Here is the summary with links:
- [net-next,1/4] net: phy: make genphy_c45_write_eee_adv() static
https://git.kernel.org/netdev/net-next/c/9c477088b60d - [net-next,2/4] net: phy: export genphy_c45_an_config_eee_aneg https://git.kernel.org/netdev/net-next/c/bcfb95c9898a - [net-next,3/4] net: phy: broadcom: use genphy_c45_an_config_eee_aneg in bcm_config_lre_aneg https://git.kernel.org/netdev/net-next/c/3cc97d2fa987 - [net-next,4/4] net: phy: remove genphy_config_eee_advert https://git.kernel.org/netdev/net-next/c/db73835f54fc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html