提交 bee0dc2f 编写于 作者: M Masahiro Yamada 提交者: Tom Rini

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: NMasahiro Yamada <yamada.m@jp.panasonic.com>
上级 cc63bb05
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册