summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2011-09-05 07:24:08 +0000
committerWolfgang Denk <wd@denx.de>2011-09-10 00:08:26 +0200
commit041c542219af7f31c372d89b4c7c6f4c8064a8ce (patch)
tree4b3cade623c59d05b32c632e97c0f0f4eba5ad97 /drivers
parente3a77218a256edbe201112a39beeed8adcabae3f (diff)
downloadu-boot-imx-041c542219af7f31c372d89b4c7c6f4c8064a8ce.zip
u-boot-imx-041c542219af7f31c372d89b4c7c6f4c8064a8ce.tar.gz
u-boot-imx-041c542219af7f31c372d89b4c7c6f4c8064a8ce.tar.bz2
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phy.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 8da7688..833a051 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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);