Netdev List
 help / color / mirror / Atom feed
* [PATCH] f_phonet: lock-less MTU change
@ 2009-08-07  7:56 Rémi Denis-Courmont
  2009-08-07  7:56 ` [PATCH] f_phonet: use page-sized rather than MTU-sized RX buffers Rémi Denis-Courmont
  2009-08-13  5:15 ` [PATCH] f_phonet: lock-less MTU change David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Rémi Denis-Courmont @ 2009-08-07  7:56 UTC (permalink / raw)
  To: netdev

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

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>
---
 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 d17f108..f4eff7c 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 = {
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-13  5:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07  7:56 [PATCH] f_phonet: lock-less MTU change Rémi Denis-Courmont
2009-08-07  7:56 ` [PATCH] f_phonet: use page-sized rather than MTU-sized RX buffers Rémi Denis-Courmont
2009-08-13  5:15   ` David Miller
2009-08-13  5:15 ` [PATCH] f_phonet: lock-less MTU change David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox