sh_eth: use EDMR_SRST_GETHER in sh_eth_check_reset()
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 24 Apr 2016 20:45:23 +0000 (23:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Apr 2016 20:07:20 +0000 (16:07 -0400)
sh_eth_check_reset() uses a bare number where EDMR_SRST_GETHER would fit,
i.e. the receive/trasmit software reset bits that comprise EDMR_SRST_GETHER
read as 1  while the corresponding reset is in progress and thus, when both
are 0, the reset is complete.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c

index edf6356c7034f7dab271c142ebf6ab0df617e6de..3d7a40af5aabf0531ba7ef998d567807aa09affd 100644 (file)
@@ -899,7 +899,7 @@ static int sh_eth_check_reset(struct net_device *ndev)
        int cnt = 100;
 
        while (cnt > 0) {
-               if (!(sh_eth_read(ndev, EDMR) & 0x3))
+               if (!(sh_eth_read(ndev, EDMR) & EDMR_SRST_GETHER))
                        break;
                mdelay(1);
                cnt--;