mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 08:01:08 +00:00
phylib: remove a couple of redundant code lines
This change slightly improves readability of the phydev speed/duplex assignment logic. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Detlev Zundel <dzu@denx.de>
This commit is contained in:
parent
e3a77218a2
commit
041c542219
1 changed files with 2 additions and 5 deletions
|
@ -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_LPA);
|
||||
|
||||
if (lpa & (LPA_100FULL | LPA_100HALF)) {
|
||||
if (lpa & (LPA_100FULL | LPA_100HALF))
|
||||
phydev->speed = SPEED_100;
|
||||
|
||||
if (lpa & LPA_100FULL)
|
||||
phydev->duplex = DUPLEX_FULL;
|
||||
|
||||
} else if (lpa & LPA_10FULL)
|
||||
if (lpa & (LPA_100FULL | LPA_10FULL))
|
||||
phydev->duplex = DUPLEX_FULL;
|
||||
} else {
|
||||
u32 bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
|
||||
|
|
Loading…
Reference in a new issue