Skip to content

Commit

Permalink
ravb: stop reading ECMR in ravb_emac_init()
Browse files Browse the repository at this point in the history
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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Jan 11, 2016
1 parent 66530bd commit 1c1fa82
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,13 @@ static int ravb_ring_init(struct net_device *ndev, int q)
static void ravb_emac_init(struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
u32 ecmr;

/* Receive frame limit set register */
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);

/* PAUSE prohibition */
ecmr = ravb_read(ndev, ECMR);
ecmr &= ECMR_DM;
ecmr |= ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
ravb_write(ndev, ecmr, ECMR);
ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
ECMR_TE | ECMR_RE, ECMR);

ravb_set_rate(ndev);

Expand Down

0 comments on commit 1c1fa82

Please sign in to comment.