diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2009-08-07 01:56:43 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 07:44:48 +0400 |
commit | 5da63cc4b2258e1c06ee41637492717481025143 (patch) | |
tree | c6e48ddaca3dfc3806b26283c1fe8760ea03c0b9 /drivers/usb/gadget/f_phonet.c | |
parent | aa11d958d1a6572eda08214d7c6a735804fe48a5 (diff) | |
download | linux-5da63cc4b2258e1c06ee41637492717481025143.tar.xz |
f_phonet: lock-less MTU change
With the current driver, the MTU is purely indicative, so there is no
need to synchronize with the receive path.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/gadget/f_phonet.c')
-rw-r--r-- | drivers/usb/gadget/f_phonet.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index d17f1082df96..f4eff7ca0d36 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c @@ -261,20 +261,10 @@ out: static int pn_net_mtu(struct net_device *dev, int new_mtu) { - struct phonet_port *port = netdev_priv(dev); - unsigned long flags; - int err = -EBUSY; - if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) return -EINVAL; - - spin_lock_irqsave(&port->lock, flags); - if (!netif_carrier_ok(dev)) { - dev->mtu = new_mtu; - err = 0; - } - spin_unlock_irqrestore(&port->lock, flags); - return err; + dev->mtu = new_mtu; + return 0; } static const struct net_device_ops pn_netdev_ops = { |