mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: dsa: bcm_sf2: Qualify phydev->dev_flags based on port
Date: Thu, 11 Mar 2021 02:36:44 +0200	[thread overview]
Message-ID: <20210311003644.tmfk6klpojrp66hg@skbuf> (raw)
In-Reply-To: <20210310221758.2969808-1-f.fainelli@gmail.com>

On Wed, Mar 10, 2021 at 02:17:58PM -0800, Florian Fainelli wrote:
> Similar to commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ("net:
> bcmgenet: Set phydev->dev_flags only for internal PHYs") we need to
> qualify the phydev->dev_flags based on whether the port is connected to
> an internal or external PHY otherwise we risk having a flags collision
> with a completely different interpretation depending on the driver.
> 
> Fixes: aa9aef77c761 ("net: dsa: bcm_sf2: communicate integrated PHY revision to PHY driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/dsa/bcm_sf2.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> index 1277e5f48b7f..321924a241f8 100644
> --- a/drivers/net/dsa/bcm_sf2.c
> +++ b/drivers/net/dsa/bcm_sf2.c
> @@ -643,7 +643,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)
>  	 * in bits 15:8 and the patch level in bits 7:0 which is exactly what
>  	 * the REG_PHY_REVISION register layout is.
>  	 */
> -	return priv->hw_params.gphy_rev;
> +	if (priv->int_phy_mask & BIT(port))
> +		return priv->hw_params.gphy_rev;
> +	else
> +		return 0;
>  }
>  
>  static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port,
> -- 
> 2.25.1
> 

Checkpatch probably tells you that "else" statements are not useful
after "return", but either way, this is good.

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

      reply	other threads:[~2021-03-11  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 22:17 Florian Fainelli
2021-03-11  0:36 ` Vladimir Oltean [this message]

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=20210311003644.tmfk6klpojrp66hg@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®