public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, bryan.whitehead@microchip.com,
	andrew@lunn.ch, linux@armlinux.org.uk,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next 1/7] net: lan743x: Create separate PCS power reset function
Date: Sat, 22 Jul 2023 21:24:13 +0100	[thread overview]
Message-ID: <ZLw67dun2790l+9D@corigine.com> (raw)
In-Reply-To: <20230721060019.2737-2-Raju.Lakkaraju@microchip.com>

On Fri, Jul 21, 2023 at 11:30:13AM +0530, Raju Lakkaraju wrote:
> Create separate PCS power reset function from lan743x_sgmii_config () to use
> as subroutine.
> 
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 54 ++++++++++---------
>  1 file changed, 29 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index a36f6369f132..dba5576a933b 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c

...

>  static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
>  {
>  	struct net_device *netdev = adapter->netdev;
> @@ -1207,31 +1235,7 @@ static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
>  		netif_dbg(adapter, drv, adapter->netdev,
>  			  "SGMII 1G mode enable\n");
>  
> -	/* SGMII/1000/2500BASE-X PCS power down */
> -	mii_ctl = lan743x_sgmii_read(adapter, MDIO_MMD_VEND2, MII_BMCR);
> -	if (mii_ctl < 0)
> -		return mii_ctl;
> -
> -	mii_ctl |= BMCR_PDOWN;
> -	ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
> -	if (ret < 0)
> -		return ret;
> -
> -	ret = lan743x_pcs_seq_state(adapter, PCS_POWER_STATE_DOWN);
> -	if (ret < 0)
> -		return ret;
> -
> -	/* SGMII/1000/2500BASE-X PCS power up */
> -	mii_ctl &= ~BMCR_PDOWN;
> -	ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
> -	if (ret < 0)
> -		return ret;
> -
> -	ret = lan743x_pcs_seq_state(adapter, PCS_POWER_STATE_UP);
> -	if (ret < 0)
> -		return ret;
> -
> -	return 0;
> +	return lan743x_pcs_power_reset(adapter);

Hi Raju,

It appears that the local variable mii_ctl is now unused
in lan743x_sgmii_config() and can be removed.

>  }
>  
>  static void lan743x_mac_set_address(struct lan743x_adapter *adapter,
> -- 
> 2.25.1
> 
> 

  reply	other threads:[~2023-07-22 20:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  6:00 [PATCH net-next 0/7] Add support to PHYLINK and SFP for PCI11x1x chips Raju Lakkaraju
2023-07-21  6:00 ` [PATCH net-next 1/7] net: lan743x: Create separate PCS power reset function Raju Lakkaraju
2023-07-22 20:24   ` Simon Horman [this message]
2023-07-21  6:00 ` [PATCH net-next 2/7] net: lan743x: Create separate Link Speed Duplex state function Raju Lakkaraju
2023-07-21  6:00 ` [PATCH net-next 3/7] net: lan743x: Add SFP support check flag Raju Lakkaraju
2023-07-21  6:00 ` [PATCH net-next 4/7] net: lan743x: Add support to software-nodes for SFP and PHYLINK Raju Lakkaraju
2023-07-21  6:00 ` [PATCH net-next 5/7] net: lan743x: Add support to the Phylink framework Raju Lakkaraju
2023-07-21  8:49   ` Russell King (Oracle)
2023-07-21 11:57     ` Russell King (Oracle)
2023-07-24  8:24       ` Raju Lakkaraju
2023-08-01 14:36         ` Russell King (Oracle)
2023-07-22 20:27   ` Simon Horman
2023-07-21  6:00 ` [PATCH net-next 6/7] net: lan743x: Add support to ethtool phylink get and set settings Raju Lakkaraju
2023-07-21  8:53   ` Russell King (Oracle)
2023-07-21  6:00 ` [PATCH net-next 7/7] net: lan743x: Register the platform device for sfp pluggable module Raju Lakkaraju

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=ZLw67dun2790l+9D@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /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