summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2013-05-08 21:42:44 +0000
committerTom Rini <trini@ti.com>2013-05-15 08:41:03 -0400
commitbee0dc2fec422175f2f23e2ed35152b40788a055 (patch)
tree7ec354e1a4463f3671f16b5bd7879f45e9ea4c33
parentcc63bb05ef271b3b63d9cd2fe1b52ff766d2fc65 (diff)
downloadu-boot-imx-bee0dc2fec422175f2f23e2ed35152b40788a055.zip
u-boot-imx-bee0dc2fec422175f2f23e2ed35152b40788a055.tar.gz
u-boot-imx-bee0dc2fec422175f2f23e2ed35152b40788a055.tar.bz2
smc911x: fix the timeout detection
If timeout is occurred at the while loop above, the value of 'timeout' is -1, not 0. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
-rw-r--r--drivers/net/smc911x.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index a290073..f63a069 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -484,7 +484,7 @@ static void smc911x_reset(struct eth_device *dev)
while (timeout-- &&
!(smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY))
udelay(10);
- if (!timeout) {
+ if (timeout < 0) {
printf(DRIVERNAME
": timeout waiting for PM restore\n");
return;
@@ -500,7 +500,7 @@ static void smc911x_reset(struct eth_device *dev)
while (timeout-- && smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
udelay(10);
- if (!timeout) {
+ if (timeout < 0) {
printf(DRIVERNAME ": reset timeout\n");
return;
}