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 3/7] usbnet:cdc-phonet: remove usb_get/put_dev in .probe and .disconnect
Date: Tue, 12 Jun 2012 09:19:41 +0800	[thread overview]
Message-ID: <1339463985-9006-4-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/cdc-phonet.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index d848d4d..187c144 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -394,7 +394,7 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	SET_NETDEV_DEV(dev, &intf->dev);
 
 	pnd->dev = dev;
-	pnd->usb = usb_get_dev(usbdev);
+	pnd->usb = usbdev;
 	pnd->intf = intf;
 	pnd->data_intf = data_intf;
 	spin_lock_init(&pnd->tx_lock);
@@ -440,7 +440,6 @@ out:
 static void usbpn_disconnect(struct usb_interface *intf)
 {
 	struct usbpn_dev *pnd = usb_get_intfdata(intf);
-	struct usb_device *usb = pnd->usb;
 
 	if (pnd->disconnected)
 		return;
@@ -449,7 +448,6 @@ static void usbpn_disconnect(struct usb_interface *intf)
 	usb_driver_release_interface(&usbpn_driver,
 			(pnd->intf == intf) ? pnd->data_intf : pnd->intf);
 	unregister_netdev(pnd->dev);
-	usb_put_dev(usb);
 }
 
 static struct usb_driver usbpn_driver = {
-- 
1.7.9.5

  parent 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 ` [PATCH 1/7] usbnet: remove usb_get/put_dev in .probe and .disconnect Ming Lei
2012-06-12  1:19 ` Ming Lei [this message]
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-4-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).