diff options
Diffstat (limited to 'drivers/usb')
-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: | |||
261 | 261 | ||
262 | static int pn_net_mtu(struct net_device *dev, int new_mtu) | 262 | static int pn_net_mtu(struct net_device *dev, int new_mtu) |
263 | { | 263 | { |
264 | struct phonet_port *port = netdev_priv(dev); | ||
265 | unsigned long flags; | ||
266 | int err = -EBUSY; | ||
267 | |||
268 | if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) | 264 | if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU)) |
269 | return -EINVAL; | 265 | return -EINVAL; |
270 | 266 | dev->mtu = new_mtu; | |
271 | spin_lock_irqsave(&port->lock, flags); | 267 | return 0; |
272 | if (!netif_carrier_ok(dev)) { | ||
273 | dev->mtu = new_mtu; | ||
274 | err = 0; | ||
275 | } | ||
276 | spin_unlock_irqrestore(&port->lock, flags); | ||
277 | return err; | ||
278 | } | 268 | } |
279 | 269 | ||
280 | static const struct net_device_ops pn_netdev_ops = { | 270 | static const struct net_device_ops pn_netdev_ops = { |