netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
To: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Subject: [PATCH v1 05/11] usbnet: int51x1: apply introduced usb command APIs
Date: Thu, 11 Oct 2012 20:39:23 +0800	[thread overview]
Message-ID: <1349959169-9432-6-git-send-email-ming.lei@canonical.com> (raw)
In-Reply-To: <1349959169-9432-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>


Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
 drivers/net/usb/int51x1.c |   52 +++------------------------------------------
 1 file changed, 3 insertions(+), 49 deletions(-)

diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c
index 8de6417..ace9e74 100644
--- a/drivers/net/usb/int51x1.c
+++ b/drivers/net/usb/int51x1.c
@@ -116,23 +116,8 @@ static struct sk_buff *int51x1_tx_fixup(struct usbnet *dev,
 	return skb;
 }
 
-static void int51x1_async_cmd_callback(struct urb *urb)
-{
-	struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
-	int status = urb->status;
-
-	if (status < 0)
-		dev_warn(&urb->dev->dev, "async callback failed with %d\n", status);
-
-	kfree(req);
-	usb_free_urb(urb);
-}
-
 static void int51x1_set_multicast(struct net_device *netdev)
 {
-	struct usb_ctrlrequest *req;
-	int status;
-	struct urb *urb;
 	struct usbnet *dev = netdev_priv(netdev);
 	u16 filter = PACKET_TYPE_DIRECTED | PACKET_TYPE_BROADCAST;
 
@@ -149,40 +134,9 @@ static void int51x1_set_multicast(struct net_device *netdev)
 		netdev_dbg(dev->net, "receive own packets only\n");
 	}
 
-	urb = usb_alloc_urb(0, GFP_ATOMIC);
-	if (!urb) {
-		netdev_warn(dev->net, "Error allocating URB\n");
-		return;
-	}
-
-	req = kmalloc(sizeof(*req), GFP_ATOMIC);
-	if (!req) {
-		netdev_warn(dev->net, "Error allocating control msg\n");
-		goto out;
-	}
-
-	req->bRequestType = USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
-	req->bRequest = SET_ETHERNET_PACKET_FILTER;
-	req->wValue = cpu_to_le16(filter);
-	req->wIndex = 0;
-	req->wLength = 0;
-
-	usb_fill_control_urb(urb, dev->udev, usb_sndctrlpipe(dev->udev, 0),
-		(void *)req, NULL, 0,
-		int51x1_async_cmd_callback,
-		(void *)req);

  parent reply	other threads:[~2012-10-11 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 12:39 [PATCH v1 00/11] usbnet: usb_control_msg cleanup Ming Lei
2012-10-11 12:39 ` [PATCH v1 02/11] usbnet: asix: apply introduced usb command APIs Ming Lei
2012-10-11 12:39 ` [PATCH v1 08/11] usbnet: plusb: " Ming Lei
2012-10-11 12:39 ` [PATCH v1 09/11] usbnet: sierra_net: " Ming Lei
2012-10-11 12:39 ` [PATCH v1 10/11] usbnet: smsc75xx: " Ming Lei
     [not found] ` <1349959169-9432-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2012-10-11 12:39   ` [PATCH v1 01/11] usbnet: introduce usbnet 3 command helpers Ming Lei
2012-10-11 12:39   ` [PATCH v1 03/11] usbnet: cdc-ncm: apply introduced usb command APIs Ming Lei
2012-10-11 12:39   ` [PATCH v1 04/11] usbnet: dm9601: " Ming Lei
2012-10-11 12:39   ` Ming Lei [this message]
2012-10-11 12:39   ` [PATCH v1 06/11] usbnet: mcs7830: " Ming Lei
2012-10-11 12:39   ` [PATCH v1 07/11] usbnet: net1080: " Ming Lei
2012-10-11 12:39   ` [PATCH v1 11/11] usbnet: smsc95xx: " Ming Lei
2012-10-15  6:30 ` [PATCH v1 00/11] usbnet: usb_control_msg cleanup Oliver Neukum
     [not found]   ` <5690496.KbQ6sjjSnW-ugxBuEnWX9yG/4A2pS7c2Q@public.gmane.org>
2012-10-23  9:19     ` Ming Lei
     [not found]       ` <CACVXFVMDWbqOONcQvs6XARecUW=A-RnQb4QuX0CBr7zf+cNtTA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-23 17:05         ` David Miller
2012-10-25  5:52           ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349959169-9432-6-git-send-email-ming.lei@canonical.com \
    --to=ming.lei-z7wlfzj8ewms+fvcfc7uqw@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oneukum-l3A5Bk7waGM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).