All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee
Date: Tue, 11 Mar 2025 13:41:12 +0100	[thread overview]
Message-ID: <ec50da60-dde3-45ca-aa6c-eebf59fc5ec5@lunn.ch> (raw)
In-Reply-To: <1c1a5c49-8c9c-42a7-b087-4a84d3585e0d@gmail.com>

On Tue, Mar 11, 2025 at 07:39:33AM +0100, Heiner Kallweit wrote:
> Use genphy_c45_eee_is_active directly instead of phy_init_eee,
> this prepares for removing phy_init_eee. With the second
> argument being Null, phy_init_eee doesn't initialize anything.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/dsa/b53/b53_common.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 61d164ffb..17e3ead16 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del);
>   */
>  int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
>  {
> -	int ret;
> -
> -	ret = phy_init_eee(phy, false);
> -	if (ret)
> +	if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0)
>  		return 0;

genphy_c45_eee_is_active() is a function which could be considered
phylib internal. At least, it currently has no users outside of the
phylib core.

b53 uses phylink not phylib, so i actually think it would be better to
convert it to the phylink way to do EEE, rather than make use of a
phylib helper.

	Andrew

	

  reply	other threads:[~2025-03-11 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11  6:39 [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee Heiner Kallweit
2025-03-11 12:41 ` Andrew Lunn [this message]
2025-03-11 13:05   ` Heiner Kallweit

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=ec50da60-dde3-45ca-aa6c-eebf59fc5ec5@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.