diff mbox series

[RFC,net-next,2/4] net: dsa: ocelot: remove interface checks

Message ID E1nNbgn-00Akik-MJ@rmk-PC.armlinux.org.uk (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: ocelot: phylink updates | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 0 this patch: 2
netdev/cc_maintainers warning 1 maintainers not CCed: linux@armlinux.org.uk
netdev/build_clang fail Errors and warnings before: 0 this patch: 4
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 0 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) Feb. 25, 2022, 2:35 p.m. UTC
When the supported interfaces bitmap is populated, phylink will itself
check that the interface mode is present in this bitmap. Drivers no
longer need to perform this check themselves. Remove these checks.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c   | 6 ------
 drivers/net/dsa/ocelot/seville_vsc9953.c | 6 ------
 2 files changed, 12 deletions(-)

Comments

Russell King (Oracle) Feb. 25, 2022, 2:37 p.m. UTC | #1
On Fri, Feb 25, 2022 at 02:35:21PM +0000, Russell King (Oracle) wrote:
> When the supported interfaces bitmap is populated, phylink will itself
> check that the interface mode is present in this bitmap. Drivers no
> longer need to perform this check themselves. Remove these checks.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Sorry, just realised I should've deleted "ocelot_port" here as well, for
some reason my build testing didn't find that. Please assume that I've
deleted it (I've updated the patch locally.) Thanks.

> ---
>  drivers/net/dsa/ocelot/felix_vsc9959.c   | 6 ------
>  drivers/net/dsa/ocelot/seville_vsc9953.c | 6 ------
>  2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
> index a1be0e91dde6..4c635c46705e 100644
> --- a/drivers/net/dsa/ocelot/felix_vsc9959.c
> +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
> @@ -956,12 +956,6 @@ static void vsc9959_phylink_validate(struct ocelot *ocelot, int port,
>  	struct ocelot_port *ocelot_port = ocelot->ports[port];
>  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
>  
> -	if (state->interface != PHY_INTERFACE_MODE_NA &&
> -	    state->interface != ocelot_port->phy_mode) {
> -		linkmode_zero(supported);
> -		return;
> -	}
> -
>  	phylink_set_port_modes(mask);
>  	phylink_set(mask, Autoneg);
>  	phylink_set(mask, Pause);
> diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c
> index 2db51494b1a9..0ae8424c47e2 100644
> --- a/drivers/net/dsa/ocelot/seville_vsc9953.c
> +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c
> @@ -929,12 +929,6 @@ static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
>  	struct ocelot_port *ocelot_port = ocelot->ports[port];
>  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
>  
> -	if (state->interface != PHY_INTERFACE_MODE_NA &&
> -	    state->interface != ocelot_port->phy_mode) {
> -		linkmode_zero(supported);
> -		return;
> -	}
> -
>  	phylink_set_port_modes(mask);
>  	phylink_set(mask, Autoneg);
>  	phylink_set(mask, Pause);
> -- 
> 2.30.2
> 
>
Vladimir Oltean Feb. 25, 2022, 3:30 p.m. UTC | #2
On Fri, Feb 25, 2022 at 02:35:21PM +0000, Russell King (Oracle) wrote:
> When the supported interfaces bitmap is populated, phylink will itself
> check that the interface mode is present in this bitmap. Drivers no
> longer need to perform this check themselves. Remove these checks.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

>  drivers/net/dsa/ocelot/felix_vsc9959.c   | 6 ------
>  drivers/net/dsa/ocelot/seville_vsc9953.c | 6 ------
>  2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
> index a1be0e91dde6..4c635c46705e 100644
> --- a/drivers/net/dsa/ocelot/felix_vsc9959.c
> +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
> @@ -956,12 +956,6 @@ static void vsc9959_phylink_validate(struct ocelot *ocelot, int port,
>  	struct ocelot_port *ocelot_port = ocelot->ports[port];
>  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
>  
> -	if (state->interface != PHY_INTERFACE_MODE_NA &&
> -	    state->interface != ocelot_port->phy_mode) {
> -		linkmode_zero(supported);
> -		return;
> -	}
> -
>  	phylink_set_port_modes(mask);
>  	phylink_set(mask, Autoneg);
>  	phylink_set(mask, Pause);
> diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c
> index 2db51494b1a9..0ae8424c47e2 100644
> --- a/drivers/net/dsa/ocelot/seville_vsc9953.c
> +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c
> @@ -929,12 +929,6 @@ static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
>  	struct ocelot_port *ocelot_port = ocelot->ports[port];
>  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
>  
> -	if (state->interface != PHY_INTERFACE_MODE_NA &&
> -	    state->interface != ocelot_port->phy_mode) {
> -		linkmode_zero(supported);
> -		return;
> -	}
> -
>  	phylink_set_port_modes(mask);
>  	phylink_set(mask, Autoneg);
>  	phylink_set(mask, Pause);
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index a1be0e91dde6..4c635c46705e 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -956,12 +956,6 @@  static void vsc9959_phylink_validate(struct ocelot *ocelot, int port,
 	struct ocelot_port *ocelot_port = ocelot->ports[port];
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 
-	if (state->interface != PHY_INTERFACE_MODE_NA &&
-	    state->interface != ocelot_port->phy_mode) {
-		linkmode_zero(supported);
-		return;
-	}
-
 	phylink_set_port_modes(mask);
 	phylink_set(mask, Autoneg);
 	phylink_set(mask, Pause);
diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c
index 2db51494b1a9..0ae8424c47e2 100644
--- a/drivers/net/dsa/ocelot/seville_vsc9953.c
+++ b/drivers/net/dsa/ocelot/seville_vsc9953.c
@@ -929,12 +929,6 @@  static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
 	struct ocelot_port *ocelot_port = ocelot->ports[port];
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 
-	if (state->interface != PHY_INTERFACE_MODE_NA &&
-	    state->interface != ocelot_port->phy_mode) {
-		linkmode_zero(supported);
-		return;
-	}
-
 	phylink_set_port_modes(mask);
 	phylink_set(mask, Autoneg);
 	phylink_set(mask, Pause);