diff mbox series

[net-next,2/4] net: fman: convert to .mac_get_caps()

Message ID E1qsPkA-009wid-Kv@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 2141297d4257f93ce214a2019d240cb602106973
Delegated to: Netdev Maintainers
Headers show
Series net: remove last of the phylink validate methods and clean up | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
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: 1360 this patch: 1360
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1385 this patch: 1385
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: 1385 this patch: 1385
netdev/checkpatch fail ERROR: Unrecognized email address: 'Sean Anderson'
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) Oct. 16, 2023, 3:42 p.m. UTC
Convert fman to use the .mac_get_caps() method rather than the
.validate() method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/freescale/fman/fman_memac.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Sean Anderson Oct. 16, 2023, 4:23 p.m. UTC | #1
On 10/16/23 11:42, Russell King (Oracle) wrote:
> Convert fman to use the .mac_get_caps() method rather than the
> .validate() method.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/ethernet/freescale/fman/fman_memac.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
> index 3b75cc543be9..9ba15d3183d7 100644
> --- a/drivers/net/ethernet/freescale/fman/fman_memac.c
> +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
> @@ -618,18 +618,17 @@ static int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en)
>  	return 0;
>  }
>  
> -static void memac_validate(struct phylink_config *config,
> -			   unsigned long *supported,
> -			   struct phylink_link_state *state)
> +static unsigned long memac_get_caps(struct phylink_config *config,
> +				    phy_interface_t interface)
>  {
>  	struct fman_mac *memac = fman_config_to_mac(config)->fman_mac;
>  	unsigned long caps = config->mac_capabilities;
>  
> -	if (phy_interface_mode_is_rgmii(state->interface) &&
> +	if (phy_interface_mode_is_rgmii(interface) &&
>  	    memac->rgmii_no_half_duplex)
>  		caps &= ~(MAC_10HD | MAC_100HD);
>  
> -	phylink_validate_mask_caps(supported, state, caps);
> +	return caps;
>  }
>  
>  /**
> @@ -776,7 +775,7 @@ static void memac_link_down(struct phylink_config *config, unsigned int mode,
>  }
>  
>  static const struct phylink_mac_ops memac_mac_ops = {
> -	.validate = memac_validate,
> +	.mac_get_caps = memac_get_caps,
>  	.mac_select_pcs = memac_select_pcs,
>  	.mac_prepare = memac_prepare,
>  	.mac_config = memac_mac_config,

Reviewed-by: Sean Anderson
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index 3b75cc543be9..9ba15d3183d7 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -618,18 +618,17 @@  static int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en)
 	return 0;
 }
 
-static void memac_validate(struct phylink_config *config,
-			   unsigned long *supported,
-			   struct phylink_link_state *state)
+static unsigned long memac_get_caps(struct phylink_config *config,
+				    phy_interface_t interface)
 {
 	struct fman_mac *memac = fman_config_to_mac(config)->fman_mac;
 	unsigned long caps = config->mac_capabilities;
 
-	if (phy_interface_mode_is_rgmii(state->interface) &&
+	if (phy_interface_mode_is_rgmii(interface) &&
 	    memac->rgmii_no_half_duplex)
 		caps &= ~(MAC_10HD | MAC_100HD);
 
-	phylink_validate_mask_caps(supported, state, caps);
+	return caps;
 }
 
 /**
@@ -776,7 +775,7 @@  static void memac_link_down(struct phylink_config *config, unsigned int mode,
 }
 
 static const struct phylink_mac_ops memac_mac_ops = {
-	.validate = memac_validate,
+	.mac_get_caps = memac_get_caps,
 	.mac_select_pcs = memac_select_pcs,
 	.mac_prepare = memac_prepare,
 	.mac_config = memac_mac_config,