diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2016-01-11 00:28:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-11 17:31:09 -0500 |
commit | bffa731f8f44e0444afc56875a10fd07e9a08c6c (patch) | |
tree | 77fe59349bc0de5be7377046e678eaa02f3ba0db /drivers/net/ethernet/renesas/sh_eth.c | |
parent | 1c1fa821199c707a193efd3bc93c4ac9357bafa0 (diff) | |
download | lwn-bffa731f8f44e0444afc56875a10fd07e9a08c6c.tar.gz lwn-bffa731f8f44e0444afc56875a10fd07e9a08c6c.zip |
sh_eth: stop reading ECMR in sh_eth_dev_init()
The code in sh_eth_dev_init() twiddling the ECMR bits always looked a bit
strange to me: if one intends to respect 'mdp->duplex', why save old value
of the ECMR.DM bit? As all the other bits are zeroed anyway, we don't really
need to read ECMR before writing to it.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 6a8fc0f341ff..9c1e290ca4ee 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1289,7 +1289,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start) { int ret = 0; struct sh_eth_private *mdp = netdev_priv(ndev); - u32 val; /* Soft Reset */ ret = sh_eth_reset(ndev); @@ -1342,10 +1341,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start) } /* PAUSE Prohibition */ - val = (sh_eth_read(ndev, ECMR) & ECMR_DM) | - ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE; - - sh_eth_write(ndev, val, ECMR); + sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | + ECMR_TE | ECMR_RE, ECMR); if (mdp->cd->set_rate) mdp->cd->set_rate(ndev); |