netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 2/5] net: stmmac: place .mac_finish() method more appropriately
Date: Thu, 16 Oct 2025 09:06:20 +0200	[thread overview]
Message-ID: <ae07b0b6-f5d2-416d-b861-412888fda229@bootlin.com> (raw)
In-Reply-To: <E1v945O-0000000AmeP-1k0t@rmk-PC.armlinux.org.uk>



On 15/10/2025 18:10, Russell King (Oracle) wrote:
> Place the .mac_finish() initialiser and implementation after the
> .mac_config() initialiser and method which reflects the order that
> they appear in struct phylink_mac_ops, and the order in which they
> are called. This keeps logically similar code together.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

> ---
>  .../net/ethernet/stmicro/stmmac/stmmac_main.c | 26 +++++++++----------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 650d75b73e0b..3728afa701c6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -859,6 +859,18 @@ static void stmmac_mac_config(struct phylink_config *config, unsigned int mode,
>  	/* Nothing to do, xpcs_config() handles everything */
>  }
>  
> +static int stmmac_mac_finish(struct phylink_config *config, unsigned int mode,
> +			     phy_interface_t interface)
> +{
> +	struct net_device *ndev = to_net_dev(config->dev);
> +	struct stmmac_priv *priv = netdev_priv(ndev);
> +
> +	if (priv->plat->mac_finish)
> +		priv->plat->mac_finish(ndev, priv->plat->bsp_priv, mode, interface);
> +
> +	return 0;
> +}
> +
>  static void stmmac_mac_link_down(struct phylink_config *config,
>  				 unsigned int mode, phy_interface_t interface)
>  {
> @@ -1053,27 +1065,15 @@ static int stmmac_mac_enable_tx_lpi(struct phylink_config *config, u32 timer,
>  	return 0;
>  }
>  
> -static int stmmac_mac_finish(struct phylink_config *config, unsigned int mode,
> -			     phy_interface_t interface)
> -{
> -	struct net_device *ndev = to_net_dev(config->dev);
> -	struct stmmac_priv *priv = netdev_priv(ndev);
> -
> -	if (priv->plat->mac_finish)
> -		priv->plat->mac_finish(ndev, priv->plat->bsp_priv, mode, interface);
> -
> -	return 0;
> -}
> -
>  static const struct phylink_mac_ops stmmac_phylink_mac_ops = {
>  	.mac_get_caps = stmmac_mac_get_caps,
>  	.mac_select_pcs = stmmac_mac_select_pcs,
>  	.mac_config = stmmac_mac_config,
> +	.mac_finish = stmmac_mac_finish,
>  	.mac_link_down = stmmac_mac_link_down,
>  	.mac_link_up = stmmac_mac_link_up,
>  	.mac_disable_tx_lpi = stmmac_mac_disable_tx_lpi,
>  	.mac_enable_tx_lpi = stmmac_mac_enable_tx_lpi,
> -	.mac_finish = stmmac_mac_finish,
>  };
>  
>  /**


  reply	other threads:[~2025-10-16  7:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 16:09 [PATCH net-next 0/5] net: stmmac: more cleanups Russell King (Oracle)
2025-10-15 16:10 ` [PATCH net-next 1/5] net: stmmac: dwc-qos-eth: move MDIO bus locking into stmmac_mdio Russell King (Oracle)
2025-10-16  7:03   ` Maxime Chevallier
2025-10-16 20:13   ` Andrew Lunn
2025-10-15 16:10 ` [PATCH net-next 2/5] net: stmmac: place .mac_finish() method more appropriately Russell King (Oracle)
2025-10-16  7:06   ` Maxime Chevallier [this message]
2025-10-16 20:15   ` Andrew Lunn
2025-10-15 16:10 ` [PATCH net-next 3/5] net: stmmac: avoid PHY speed change when configuring MTU Russell King (Oracle)
2025-10-16  7:22   ` Maxime Chevallier
2025-10-16  7:44   ` [Linux-stm32] " Gatien CHEVALLIER
2025-10-16 20:16   ` Andrew Lunn
2025-10-15 16:10 ` [PATCH net-next 4/5] net: stmmac: rearrange tc_init() Russell King (Oracle)
2025-10-16  7:25   ` Maxime Chevallier
2025-10-15 16:11 ` [PATCH net-next 5/5] net: stmmac: rename stmmac_phy_setup() to include phylink Russell King (Oracle)
2025-10-16  7:26   ` Maxime Chevallier
2025-10-16  7:37   ` [Linux-stm32] " Gatien CHEVALLIER
2025-10-16 20:23   ` Andrew Lunn
2025-10-16 23:10 ` [PATCH net-next 0/5] net: stmmac: more cleanups patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae07b0b6-f5d2-416d-b861-412888fda229@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).