aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-06-05 15:54:01 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-11 05:28:48 -0400
commit9f8c4265bda4a6e9aa97041d5cfd91386f460b65 (patch)
treec3a00621d581f3f03ccb04305f2bd85e34541de0
parent2786aae7fc935e44f81d5f359b6a768c81b46a9b (diff)
sh_eth: fix result of sh_eth_check_reset() on timeout
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>
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 42e9dd05c936..b4479b5aaee4 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -897,8 +897,8 @@ static int sh_eth_check_reset(struct net_device *ndev)
897 mdelay(1); 897 mdelay(1);
898 cnt--; 898 cnt--;
899 } 899 }
900 if (cnt < 0) { 900 if (cnt <= 0) {
901 pr_err("Device reset fail\n"); 901 pr_err("Device reset failed\n");
902 ret = -ETIMEDOUT; 902 ret = -ETIMEDOUT;
903 } 903 }
904 return ret; 904 return ret;