Commit 1c1fa821 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller
Browse files

ravb: stop reading ECMR in ravb_emac_init()



The code in ravb_emac_init() twiddling the ECMR bits always looked a bit
strange to me: if one intends to respect 'priv->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 66530bdf
...@@ -338,16 +338,13 @@ error: ...@@ -338,16 +338,13 @@ error:
static void ravb_emac_init(struct net_device *ndev) static void ravb_emac_init(struct net_device *ndev)
{ {
struct ravb_private *priv = netdev_priv(ndev); struct ravb_private *priv = netdev_priv(ndev);
u32 ecmr;
/* Receive frame limit set register */ /* Receive frame limit set register */
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR); ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
/* PAUSE prohibition */ /* PAUSE prohibition */
ecmr = ravb_read(ndev, ECMR); ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
ecmr &= ECMR_DM; ECMR_TE | ECMR_RE, ECMR);
ecmr |= ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
ravb_write(ndev, ecmr, ECMR);
ravb_set_rate(ndev); ravb_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