Skip to content
Snippets Groups Projects
Commit 041c5422 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Wolfgang Denk
Browse files

phylib: remove a couple of redundant code lines


This change slightly improves readability of the phydev speed/duplex
assignment logic.

Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Acked-by: default avatarDetlev Zundel <dzu@denx.de>
parent e3a77218
No related branches found
No related tags found
No related merge requests found
...@@ -318,13 +318,10 @@ static int genphy_parse_link(struct phy_device *phydev) ...@@ -318,13 +318,10 @@ static int genphy_parse_link(struct phy_device *phydev)
lpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE); lpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE);
lpa &= phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA); lpa &= phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA);
if (lpa & (LPA_100FULL | LPA_100HALF)) { if (lpa & (LPA_100FULL | LPA_100HALF))
phydev->speed = SPEED_100; phydev->speed = SPEED_100;
if (lpa & LPA_100FULL) if (lpa & (LPA_100FULL | LPA_10FULL))
phydev->duplex = DUPLEX_FULL;
} else if (lpa & LPA_10FULL)
phydev->duplex = DUPLEX_FULL; phydev->duplex = DUPLEX_FULL;
} else { } else {
u32 bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); u32 bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment