Subject: Re: [PATCH v2] net: dsa: mt7530: add support for in-band link status

From: Jakub Kicinski <[email-masked]>
Date: Mon, 19 Sep 2022 18:36:22 -0700

On Sun, 11 Sep 2022 21:45:30 +0100 Daniel Golle wrote:
>  static void mt7531_pcs_get_state(struct phylink_pcs *pcs,
>  				 struct phylink_link_state *state)
>  {
>  	struct mt7530_priv *priv = pcs_to_mt753x_pcs(pcs)->priv;
>  	int port = pcs_to_mt753x_pcs(pcs)->port;
> +	unsigned int val;
>  
> -	if (state->interface == PHY_INTERFACE_MODE_SGMII)
> +	if (state->interface == PHY_INTERFACE_MODE_SGMII) {
>  		mt7531_sgmii_pcs_get_state_an(priv, port, state);
> -	else
> -		state->link = false;
> +		return;
> +	} else if ((state->interface == PHY_INTERFACE_MODE_1000BASEX) ||
> +		   (state->interface == PHY_INTERFACE_MODE_2500BASEX)) {
> +		mt7531_sgmii_pcs_get_state_inband(priv, port, state);
> +		return;
> +	}
> +
> +	state->link = false;

drivers/net/dsa/mt7530.c:3040:15: warning: unused variable 'val' [-Wunused-variable]
        unsigned int val;
                     ^