Commit bffa731f authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

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: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c1fa821
...@@ -1289,7 +1289,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start) ...@@ -1289,7 +1289,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
{ {
int ret = 0; int ret = 0;
struct sh_eth_private *mdp = netdev_priv(ndev); struct sh_eth_private *mdp = netdev_priv(ndev);
u32 val;
/* Soft Reset */ /* Soft Reset */
ret = sh_eth_reset(ndev); ret = sh_eth_reset(ndev);
...@@ -1342,10 +1341,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start) ...@@ -1342,10 +1341,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
} }
/* PAUSE Prohibition */ /* PAUSE Prohibition */
val = (sh_eth_read(ndev, ECMR) & ECMR_DM) | sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) |
ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE; ECMR_TE | ECMR_RE, ECMR);
sh_eth_write(ndev, val, ECMR);
if (mdp->cd->set_rate) if (mdp->cd->set_rate)
mdp->cd->set_rate(ndev); mdp->cd->set_rate(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment