aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/mvneta.c
diff options
context:
space:
mode:
authorMarek BehĂșn2022-04-27 12:41:53 +0200
committerStefan Roese2022-05-04 07:05:51 +0200
commitca4730a46639201daa2acb807b17e422605fc0ae (patch)
tree082b846fcfb56f1b8b8e9058f27f0a81535847dc /drivers/net/mvneta.c
parent7ec50404ae65b081554ac5cceb1e60524413177f (diff)
net: mvneta: Drop one indentation level in mvneta_adjust_link()
Drop one indentation level in the mvneta_adjust_link() function. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/net/mvneta.c')
-rw-r--r--drivers/net/mvneta.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 72789fc5c6c..66d5e101742 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) {