summaryrefslogtreecommitdiff
path: root/drivers/qe
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2010-08-11 11:44:21 +0200
committerBen Warren <biggerbadderben@gmail.com>2010-10-11 22:47:48 -0700
commitbd6c25afd23a656b2283b7aecd893c1a16bcd585 (patch)
treefdba767c76860369ea69ca8245039a633cd31fd2 /drivers/qe
parentb7081d91977aa3bf0cfc8284a463bd3901d0d6ad (diff)
downloadu-boot-imx-bd6c25afd23a656b2283b7aecd893c1a16bcd585.zip
u-boot-imx-bd6c25afd23a656b2283b7aecd893c1a16bcd585.tar.gz
u-boot-imx-bd6c25afd23a656b2283b7aecd893c1a16bcd585.tar.bz2
UEC: Don't udelay needlessly
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Acked-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/qe')
-rw-r--r--drivers/qe/uec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index e10c0f3..48033d7 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -1223,8 +1223,10 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
i = 50;
do {
err = curphy->read_status(uec->mii_info);
+ if (!(((i-- > 0) && !uec->mii_info->link) || err))
+ break;
udelay(100000);
- } while (((i-- > 0) && !uec->mii_info->link) || err);
+ } while (1);
if (err || i <= 0)
printf("warning: %s: timeout on PHY link\n", dev->name);