Skip to content

Commit

Permalink
net: driver: stmicro: Remove some useless the lock protection
Browse files Browse the repository at this point in the history
kernel always invokes a pair of rtnl_lock adn rtnl_unlock to
protect dev_ethtool(), so its not neccessary to invoke spin_lock/unlock
in ethtool_ops.

Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Wei authored and David S. Miller committed May 25, 2014
1 parent ea5930f commit cab6715
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,7 @@ static int stmmac_ethtool_getsettings(struct net_device *dev,
return -EBUSY;
}
cmd->transceiver = XCVR_INTERNAL;
spin_lock_irq(&priv->lock);
rc = phy_ethtool_gset(phy, cmd);
spin_unlock_irq(&priv->lock);
return rc;
}

Expand Down Expand Up @@ -442,7 +440,6 @@ stmmac_get_pauseparam(struct net_device *netdev,
if (priv->flow_ctrl & FLOW_TX)
pause->tx_pause = 1;

spin_unlock(&priv->lock);
}

static int
Expand All @@ -457,8 +454,6 @@ stmmac_set_pauseparam(struct net_device *netdev,
if (priv->pcs) /* FIXME */
return -EOPNOTSUPP;

spin_lock(&priv->lock);

if (pause->rx_pause)
new_pause |= FLOW_RX;
if (pause->tx_pause)
Expand All @@ -473,7 +468,6 @@ stmmac_set_pauseparam(struct net_device *netdev,
} else
priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
priv->flow_ctrl, priv->pause);
spin_unlock(&priv->lock);
return ret;
}

Expand Down

0 comments on commit cab6715

Please sign in to comment.