mirror of
https://xff.cz/git/u-boot/
synced 2025-09-04 02:02:08 +02:00
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>
This commit is contained in:
committed by
Tom Rini
parent
cc63bb05ef
commit
bee0dc2fec
@@ -484,7 +484,7 @@ static void smc911x_reset(struct eth_device *dev)
|
|||||||
while (timeout-- &&
|
while (timeout-- &&
|
||||||
!(smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY))
|
!(smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY))
|
||||||
udelay(10);
|
udelay(10);
|
||||||
if (!timeout) {
|
if (timeout < 0) {
|
||||||
printf(DRIVERNAME
|
printf(DRIVERNAME
|
||||||
": timeout waiting for PM restore\n");
|
": timeout waiting for PM restore\n");
|
||||||
return;
|
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)
|
while (timeout-- && smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
|
||||||
udelay(10);
|
udelay(10);
|
||||||
|
|
||||||
if (!timeout) {
|
if (timeout < 0) {
|
||||||
printf(DRIVERNAME ": reset timeout\n");
|
printf(DRIVERNAME ": reset timeout\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user