[PATCH u-boot-marvell 17/19] net: mvneta: Drop fixed_link member from private struct

Stefan Roese sr at denx.de
Mon May 2 09:03:14 CEST 2022


On 27.04.22 12:42, Marek Behún wrote:
> From: Marek Behún <marek.behun at nic.cz>
> 
> Since this member is checked only at two places drop it and inline it's
> usage.
> 
> Signed-off-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan


> ---
>   drivers/net/mvneta.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
> index 4917857681..378789b632 100644
> --- a/drivers/net/mvneta.c
> +++ b/drivers/net/mvneta.c
> @@ -273,7 +273,6 @@ struct mvneta_port {
>   	u16 rx_ring_size;
>   
>   	phy_interface_t phy_interface;
> -	bool fixed_link;
>   	unsigned int link;
>   	unsigned int duplex;
>   	unsigned int speed;
> @@ -813,7 +812,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
>   	mvreg_write(pp, MVNETA_SDMA_CONFIG, val);
>   
>   	/* Enable PHY polling in hardware if not in fixed-link mode */
> -	if (!pp->fixed_link) {
> +	if (pp->phydev->phy_id != PHY_FIXED_ID) {
>   		mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr);
>   
>   		val = mvreg_read(pp, MVNETA_UNIT_CONTROL);
> @@ -1173,7 +1172,7 @@ static void mvneta_adjust_link(struct udevice *dev)
>   		 * be added). Also, why is ADVERT_FC enabled if we don't enable
>   		 * inband AN at all?
>   		 */
> -		if (pp->fixed_link)
> +		if (pp->phydev->phy_id == PHY_FIXED_ID)
>   			val = MVNETA_GMAC_FORCE_LINK_UP |
>   			      MVNETA_GMAC_IB_BYPASS_AN_EN |
>   			      MVNETA_GMAC_SET_FC_EN |
> @@ -1431,8 +1430,6 @@ static int mvneta_start(struct udevice *dev)
>   			return -ENODEV;
>   		}
>   
> -		pp->fixed_link = phydev->phy_id == PHY_FIXED_ID;
> -
>   		pp->phydev = phydev;
>   		phy_config(phydev);
>   		phy_startup(phydev);

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list