From bd6c25afd23a656b2283b7aecd893c1a16bcd585 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 11 Aug 2010 11:44:21 +0200 Subject: [PATCH] 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 Acked-by: Kim Phillips Signed-off-by: Ben Warren --- drivers/qe/uec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index e10c0f328c..48033d750c 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); -- 2.25.1