Skip to content

Commit

Permalink
sh_eth: fix result of sh_eth_check_reset() on timeout
Browse files Browse the repository at this point in the history
When  the first loop in sh_eth_check_reset() runs to its end, 'cnt' is 0, so the
following check for 'cnt < 0' fails to catch the timeout.  Fix the  condition in
this check, so that the timeout  is actually reported.
While at it, fix the grammar in the failure message...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Jun 11, 2013
1 parent 2786aae commit 9f8c426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,8 @@ static int sh_eth_check_reset(struct net_device *ndev)
mdelay(1);
cnt--;
}
if (cnt < 0) {
pr_err("Device reset fail\n");
if (cnt <= 0) {
pr_err("Device reset failed\n");
ret = -ETIMEDOUT;
}
return ret;
Expand Down

0 comments on commit 9f8c426

Please sign in to comment.