[PATCH net-next 1/5] net: stmmac: Drop TBI/RTBI PCS flags

Serge Semin fancer.lancer at gmail.com
Tue May 28 05:26:10 PDT 2024


On Tue, May 28, 2024 at 12:48:37PM +0100, Russell King wrote:
> From: Serge Semin <fancer.lancer at gmail.com>
> 
> First of all the flags are never set by any of the driver parts. If nobody
> have them set then the respective statements will always have the same
> result. Thus the statements can be simplified or even dropped with no risk
> to break things.
> 
> Secondly shall any of the TBI or RTBI flag is set the MDIO-bus
> registration will be bypassed. Why? It really seems weird. It's perfectly
> fine to have a TBI/RTBI-capable PHY configured over the MDIO bus
> interface.
> 
> Based on the notes above the TBI/RTBI PCS flags can be freely dropped thus
> simplifying the driver code.

Likely by mistake the vast majority of the original patch content has
been missing here:
https://lore.kernel.org/netdev/20240524210304.9164-3-fancer.lancer@gmail.com/

-Serge(y)

> 
> Signed-off-by: Serge Semin <fancer.lancer at gmail.com>
> Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b3afc7cb7d72..e01340034d50 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7833,10 +7833,7 @@ void stmmac_dvr_remove(struct device *dev)
>  	reset_control_assert(priv->plat->stmmac_ahb_rst);
>  
>  	stmmac_pcs_clean(ndev);
> -
> -	if (priv->hw->pcs != STMMAC_PCS_TBI &&
> -	    priv->hw->pcs != STMMAC_PCS_RTBI)
> -		stmmac_mdio_unregister(ndev);
> +	stmmac_mdio_unregister(ndev);
>  	destroy_workqueue(priv->wq);
>  	mutex_destroy(&priv->lock);
>  	bitmap_free(priv->af_xdp_zc_qps);
> -- 
> 2.30.2
> 



More information about the linux-arm-kernel mailing list