diff mbox series

[v2,net-next] ixgene-v2: prepare for phylib stop exporting phy_10_100_features_array

Message ID be356a21-5a1a-45b3-9407-3a97f3af4600@gmail.com (mailing list archive)
State Accepted
Commit 5077bc7af28f649d669f9cda6b5fedecedfaef2d
Delegated to: Netdev Maintainers
Headers show
Series [v2,net-next] ixgene-v2: prepare for phylib stop exporting phy_10_100_features_array | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 30 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-12--09-00 (tests: 889)

Commit Message

Heiner Kallweit Feb. 12, 2025, 6:32 a.m. UTC
As part of phylib cleanup we plan to stop exporting the feature arrays.
So explicitly remove the modes not supported by the MAC. The media type
bits don't have any impact on kernel behavior, so don't touch them.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- use phy_remove_link_mode()
---
 drivers/net/ethernet/apm/xgene-v2/mdio.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Andrew Lunn Feb. 12, 2025, 1:44 p.m. UTC | #1
On Wed, Feb 12, 2025 at 07:32:52AM +0100, Heiner Kallweit wrote:
> As part of phylib cleanup we plan to stop exporting the feature arrays.
> So explicitly remove the modes not supported by the MAC. The media type
> bits don't have any impact on kernel behavior, so don't touch them.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Mateusz Polchlopek Feb. 12, 2025, 2:14 p.m. UTC | #2
On 2/12/2025 7:32 AM, Heiner Kallweit wrote:
> As part of phylib cleanup we plan to stop exporting the feature arrays.
> So explicitly remove the modes not supported by the MAC. The media type
> bits don't have any impact on kernel behavior, so don't touch them.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - use phy_remove_link_mode()
> ---
>   drivers/net/ethernet/apm/xgene-v2/mdio.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/apm/xgene-v2/mdio.c b/drivers/net/ethernet/apm/xgene-v2/mdio.c
> index eba06831a..6a17045a5 100644
> --- a/drivers/net/ethernet/apm/xgene-v2/mdio.c
> +++ b/drivers/net/ethernet/apm/xgene-v2/mdio.c
> @@ -97,7 +97,6 @@ void xge_mdio_remove(struct net_device *ndev)
>   
>   int xge_mdio_config(struct net_device *ndev)
>   {
> -	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
>   	struct xge_pdata *pdata = netdev_priv(ndev);
>   	struct device *dev = &pdata->pdev->dev;
>   	struct mii_bus *mdio_bus;
> @@ -137,17 +136,12 @@ int xge_mdio_config(struct net_device *ndev)
>   		goto err;
>   	}
>   
> -	linkmode_set_bit_array(phy_10_100_features_array,
> -			       ARRAY_SIZE(phy_10_100_features_array),
> -			       mask);
> -	linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, mask);
> -	linkmode_set_bit(ETHTOOL_LINK_MODE_AUI_BIT, mask);
> -	linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask);
> -	linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, mask);
> -	linkmode_set_bit(ETHTOOL_LINK_MODE_BNC_BIT, mask);
> -
> -	linkmode_andnot(phydev->supported, phydev->supported, mask);
> -	linkmode_copy(phydev->advertising, phydev->supported);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
> +
>   	pdata->phy_speed = SPEED_UNKNOWN;
>   
>   	return 0;

Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
patchwork-bot+netdevbpf@kernel.org Feb. 13, 2025, 4:50 p.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 12 Feb 2025 07:32:52 +0100 you wrote:
> As part of phylib cleanup we plan to stop exporting the feature arrays.
> So explicitly remove the modes not supported by the MAC. The media type
> bits don't have any impact on kernel behavior, so don't touch them.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - use phy_remove_link_mode()
> 
> [...]

Here is the summary with links:
  - [v2,net-next] ixgene-v2: prepare for phylib stop exporting phy_10_100_features_array
    https://git.kernel.org/netdev/net-next/c/5077bc7af28f

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/apm/xgene-v2/mdio.c b/drivers/net/ethernet/apm/xgene-v2/mdio.c
index eba06831a..6a17045a5 100644
--- a/drivers/net/ethernet/apm/xgene-v2/mdio.c
+++ b/drivers/net/ethernet/apm/xgene-v2/mdio.c
@@ -97,7 +97,6 @@  void xge_mdio_remove(struct net_device *ndev)
 
 int xge_mdio_config(struct net_device *ndev)
 {
-	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 	struct xge_pdata *pdata = netdev_priv(ndev);
 	struct device *dev = &pdata->pdev->dev;
 	struct mii_bus *mdio_bus;
@@ -137,17 +136,12 @@  int xge_mdio_config(struct net_device *ndev)
 		goto err;
 	}
 
-	linkmode_set_bit_array(phy_10_100_features_array,
-			       ARRAY_SIZE(phy_10_100_features_array),
-			       mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_AUI_BIT, mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_BNC_BIT, mask);
-
-	linkmode_andnot(phydev->supported, phydev->supported, mask);
-	linkmode_copy(phydev->advertising, phydev->supported);
+	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
+	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT);
+	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
+	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT);
+	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
+
 	pdata->phy_speed = SPEED_UNKNOWN;
 
 	return 0;