]> git.sur5r.net Git - u-boot/commitdiff
UEC: Don't udelay needlessly
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Wed, 11 Aug 2010 09:44:21 +0000 (11:44 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Tue, 12 Oct 2010 05:47:48 +0000 (22:47 -0700)
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>
drivers/qe/uec.c

index e10c0f328c4ae8e94976b2b3ce743b9226f1da91..48033d750c3cee5eb649ee67889e37a0405220c0 100644 (file)
@@ -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);