sh_eth: fix result of sh_eth_check_reset() on timeout
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Wed, 5 Jun 2013 19:54:01 +0000 (23:54 +0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jun 2013 09:28:48 +0000 (02:28 -0700)
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>
drivers/net/ethernet/renesas/sh_eth.c

index 42e9dd05c936df55e2bc62754259e1ff6e81785d..b4479b5aaee43ba49bb254f9fdeaf7cea7638b1c 100644 (file)
@@ -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;