Re: [PATCH 5.10 051/173] net: dsa: mt7530: move setting ssc_delta to PHY_INTERFACE_MODE_TRGMII case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> [ Upstream commit 407b508bdd70b6848993843d96ed49ac4108fb52 ]
> 
> Move setting the ssc_delta variable to under the PHY_INTERFACE_MODE_TRGMII
> case as it's only needed when trgmii is used.

This one is very wrong for 5.10. ssc_delta is unconditionally used
below, and it will not use uninitialized variable.

(In mainline, that code is protected by if (trgint), so it does not
have this problem).

Best regards,
								Pavel

> +++ b/drivers/net/dsa/mt7530.c
> @@ -403,6 +403,10 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
>  		break;
>  	case PHY_INTERFACE_MODE_TRGMII:
>  		trgint = 1;
> +		if (xtal == HWTRAP_XTAL_25MHZ)
> +			ssc_delta = 0x57;
> +		else
> +			ssc_delta = 0x87;
>  		if (priv->id == ID_MT7621) {
>  			/* PLL frequency: 150MHz: 1.2GBit */
>  			if (xtal == HWTRAP_XTAL_40MHZ)
> @@ -422,11 +426,6 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
>  		return -EINVAL;
>  	}
>  
> -	if (xtal == HWTRAP_XTAL_25MHZ)
> -		ssc_delta = 0x57;
> -	else
> -		ssc_delta = 0x87;
> -
>  	mt7530_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_MASK,
>  		   P6_INTF_MODE(trgint));
>  

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux