[PATCH u-boot-marvell 10/19] net: mvneta: Drop one indentation level in mvneta_adjust_link()
Stefan Roese
sr at denx.de
Mon May 2 09:01:34 CEST 2022
On 27.04.22 12:41, Marek Behún wrote:
> From: Marek Behún <marek.behun at nic.cz>
>
> Drop one indentation level in the mvneta_adjust_link() function.
>
> 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 | 38 ++++++++++++++++++--------------------
> 1 file changed, 18 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
> index 72789fc5c6..66d5e10174 100644
> --- a/drivers/net/mvneta.c
> +++ b/drivers/net/mvneta.c
> @@ -1161,31 +1161,29 @@ static void mvneta_adjust_link(struct udevice *dev)
> return;
> }
>
> - if (phydev->link) {
> - if ((pp->speed != phydev->speed) ||
> - (pp->duplex != phydev->duplex)) {
> - u32 val;
> + if (phydev->link &&
> + (pp->speed != phydev->speed || pp->duplex != phydev->duplex)) {
> + u32 val;
>
> - val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
> - val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED |
> - MVNETA_GMAC_CONFIG_GMII_SPEED |
> - MVNETA_GMAC_CONFIG_FULL_DUPLEX |
> - MVNETA_GMAC_AN_SPEED_EN |
> - MVNETA_GMAC_AN_DUPLEX_EN);
> + val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
> + val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED |
> + MVNETA_GMAC_CONFIG_GMII_SPEED |
> + MVNETA_GMAC_CONFIG_FULL_DUPLEX |
> + MVNETA_GMAC_AN_SPEED_EN |
> + MVNETA_GMAC_AN_DUPLEX_EN);
>
> - if (phydev->duplex)
> - val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
> + if (phydev->duplex)
> + val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
>
> - if (phydev->speed == SPEED_1000)
> - val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
> - else if (pp->speed == SPEED_100)
> - val |= MVNETA_GMAC_CONFIG_MII_SPEED;
> + if (phydev->speed == SPEED_1000)
> + val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
> + else if (pp->speed == SPEED_100)
> + val |= MVNETA_GMAC_CONFIG_MII_SPEED;
>
> - mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
> + mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
>
> - pp->duplex = phydev->duplex;
> - pp->speed = phydev->speed;
> - }
> + pp->duplex = phydev->duplex;
> + pp->speed = phydev->speed;
> }
>
> if (phydev->link != pp->link) {
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