netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oliver Neukum <oneukum@suse.de>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	Ming Lei <tom.leiming@gmail.com>
Subject: [PATCH 1/7] usbnet: remove usb_get/put_dev in .probe and .disconnect
Date: Tue, 12 Jun 2012 09:19:39 +0800	[thread overview]
Message-ID: <1339463985-9006-2-git-send-email-tom.leiming@gmail.com> (raw)
In-Reply-To: <1339463985-9006-1-git-send-email-tom.leiming@gmail.com>

usb_device is parent device of usb_interface in the view of driver
model, so its reference count is always held during .probe/.disconnect
of usb_interface instance.

This patch just removes the unnecessay usb_get/put_dev.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/net/usb/usbnet.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9f58330..022c1e7 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1307,7 +1307,6 @@ void usbnet_disconnect (struct usb_interface *intf)
 	usb_free_urb(dev->interrupt);
 
 	free_netdev(net);
-	usb_put_dev (xdev);
 }
 EXPORT_SYMBOL_GPL(usbnet_disconnect);
 
@@ -1363,8 +1362,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 	xdev = interface_to_usbdev (udev);
 	interface = udev->cur_altsetting;
 
-	usb_get_dev (xdev);
-
 	status = -ENOMEM;
 
 	// set up our own records
@@ -1493,7 +1490,6 @@ out3:
 out1:
 	free_netdev(net);
 out:
-	usb_put_dev(xdev);
 	return status;
 }
 EXPORT_SYMBOL_GPL(usbnet_probe);
-- 
1.7.9.5

  reply	other threads:[~2012-06-12  1:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12  1:19 [PATCH 0/7] usbnet: misc cleanup Ming Lei
2012-06-12  1:19 ` Ming Lei [this message]
2012-06-12  1:19 ` [PATCH 3/7] usbnet:cdc-phonet: remove usb_get/put_dev in .probe and .disconnect Ming Lei
2012-06-12  1:19 ` [PATCH 5/7] usbnet: remove flag of EVENT_DEV_WAKING Ming Lei
     [not found] ` <1339463985-9006-1-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-06-12  1:19   ` [PATCH 2/7] usbnet:pegasus: remove usb_get/put_dev in .probe and .disconnect Ming Lei
2012-06-12  1:19   ` [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag Ming Lei
     [not found]     ` <1339463985-9006-5-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-06-12 18:14       ` Oliver Neukum
2012-06-13  2:12         ` Ming Lei
2012-06-13  4:47           ` Ming Lei
2012-06-13  7:40             ` Oliver Neukum
     [not found]               ` <201206130940.54817.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2012-06-13  8:28                 ` Bjørn Mork
     [not found]                   ` <87r4tjlio1.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2012-06-13  9:21                     ` Ming Lei
2012-06-12  1:19   ` [PATCH 6/7] usbnet: remove declaration for intr_complete Ming Lei
2012-06-12  1:19   ` [PATCH 7/7] usbnet: don't initialize transfer buffer before submit status URB Ming Lei
2012-06-13  1:51   ` [PATCH 0/7] usbnet: misc cleanup David Miller

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=1339463985-9006-2-git-send-email-tom.leiming@gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.de \
    /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).